Page 1 of 1

Re: Declaration Cursor location in DB2.

Posted: Wed May 28, 2014 12:19 am
by Anuj Dhawan
Hello,

When you declare a cursor in the Procedure Division, make sure you don't issue an OPEN for it before you declare it -- because it's a procedure division, you can do so and pre-compiler and compiler won't complain about it though as a programmer you'd need to take care about it.

Hope this helps.

Re: Declaration Cursor location in DB2.

Posted: Wed May 28, 2014 12:22 am
by zprogrammer
I would reply the value of host variable needs to be populated before doing a open cursor irrespective of the where the cursor is declared and also ensure OPEN of cursor should not be done