Page 1 of 1

CURSOR handling

PostPosted: Tue Nov 25, 2008 1:46 pm
by kiran_q
can anyone tell me is it mandatory to move initial values to host variables before declaring the cursor, why because am getting sqlcode 100 if value is not moved before declaration.

Re: CURSOR handling

PostPosted: Wed Nov 26, 2008 2:12 am
by dick scherrer
Hello,

It is mandantory to initialize the host variables used in the predicates of the cursor query before opening the cursor.

As the DECLARE is often done in working-storage, no, there is no requirement to initialize before the declare.