DB2 SQL referencing a list
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The first format is easiest; the routine reads a line at a time and returns a comma-delimited list. You then use the result of the function as your "list of things" in a StartLoop activity in a job sequence.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Hey again Ray,
Well i appear to have set the value of the parameter correctly.
This is the value of the param passed in:
So thats all good. But when I run the following code:
I end up recieving the following wonky error:
Do you know why this may be occuring? or why it changed the value of my string input? The parameter is defined as a string.
Thanks,
Adam
Well i appear to have set the value of the parameter correctly.
This is the value of the param passed in:
Code: Select all
ppFNDPolicyList='0136530000','0322430008','0414643009','0532516008'
Code: Select all
SELECT CTR_POL_NUM, CTR_RSA_TOT_PREM
FROM DMIDBO.CTR_TRANSACTION
WHERE
CTR_SOURCE_SYSTEM IN ('HC' , 'HF') AND
CTR_POL_NUM IN (#ppFNDPolicyList#)
GROUP BY CTR_POL_NUM
WITH UR
;
Code: Select all
APT_CombinedOperatorController,0: Fatal Error: Fatal: [IBM][CLI Driver][DB2] SQL0104N An unexpected token " " was found following "". Expected tokens may include: "( + - ? : CASE CAST USER SELECT <FLOAT> CURRENT <DECIMAL> ". SQLSTATE=42601
SQLExecDirect: Error executing statement 'SELECT CTR_POL_NUM, CTR_RSA_TOT_PREM
FROM DMIDBO.CTR_TRANSACTION
WHERE
CTR_SOURCE_SYSTEM IN ('HC' , 'HF') AND
CTR_POL_NUM IN (6530000\,2430008\,!4643009\,+2516008\)
GROUP BY CTR_POL_NUM
WITH UR
'. See following DB2 message for details.
Thanks,
Adam
Adam Love