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
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
IBM did not change the default of the reuse deleted files function to YES for physical files in order to minimize the impact on any existing ... 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.