SQL R040_PRD_GRP_DESC SQL from CSSDM01040 SQL SQL Where R040_PRD_GRP_ROLLUP Not In " & W-excl & " SQL group by R040_PRD_GRP_ROLLUP , SQL R040_PRODUCT_GROUP , SQL R040_PRD_GRP_DESC SQL End-Exec. 0090.00 0091.00 String '(' Delimited by Size 0092.00 '00' Delimited by Size 0093.00 ', ' Delimited by Size 0094.00 '27' Delimited by Size 0095.00 ')' Delimited by Size 0096.00 Into W-Excl 0097.00 0099.00
Here's what the psuedo-code would look like:
DECLARE C1 CURSOR FOR S1 ; SET W-Excl = '(00,27'); SET mystmt = 'SELECT R040_PRD_GRP_ROLLUP,R040_PRODUCT_GROUP,R040_PRD_GRP_DESC, COUNT (*) from CSSDM01040 Where R040_PRD_GRP_ROLLUP Not In ' || W-excl || ' group by R040_PRD_GRP_ROLLUP,R040_PRODUCT_GROUP,R040_PRD_GRP_DESC' PREPARE S1 FROM mystmt ; OPEN C1 ; FETCH C1 INTO :rollupvar, :groupvar, :descvar, :countvar ; ....
Dig Deeper on DB2 UDB (universal databases)
Related Q&A from Kent Milligan
To solve the SQL error -321 on IBM i6.1, use the new values statement to overcome the error. If you are using an older release, declare a cursor ... Continue Reading
When working with DB2 files with columns that have both short and long names, there is no option choose which column names are returned via ODBC ... Continue Reading
When developing tables in a parent-child relationship, use a primary key and a foreign key along with a unique ID to make your database easier to ... Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.