attached is a small standalone pgm that anyone could run to help me out with this. ( you would need the file object however for actual execution).
but will compile and allow you to see what I'm attempting.
I'm trying my best to build a cursor over a pre-constructed sql statement (file/columns) unknown... but for sake of sample pgm, i have hardcoded a statement in the host variable.
I then want to fetch the cursor for that sql statement and process the fetched row (does this come from sqlda/sqlvar's?) and populate a host variable ds. if so, how do they get processed? i've read and attempted various methods, none with successful results, so hoping for some code specific for my processing.
And one other piece of confusion regarding my current code in attachment, when the fetch occurs, on my system, the record does indeed exist... sqlcode is set to 0, BUT if I look a the joblog, it says 0 records fetched.
I'm confused... can someone please help me with this piece of a much bigger application?
but will compile and allow you to see what I'm attempting.
I'm trying my best to build a cursor over a pre-constructed sql statement (file/columns) unknown... but for sake of sample pgm, i have hardcoded a statement in the host variable.
I then want to fetch the cursor for that sql statement and process the fetched row (does this come from sqlda/sqlvar's?) and populate a host variable ds. if so, how do they get processed? i've read and attempted various methods, none with successful results, so hoping for some code specific for my processing.
And one other piece of confusion regarding my current code in attachment, when the fetch occurs, on my system, the record does indeed exist... sqlcode is set to 0, BUT if I look a the joblog, it says 0 records fetched.
I'm confused... can someone please help me with this piece of a much bigger application?
Comment