hi
Intwerviewer asked that, "Cusror can be declared in data division and procedure division. If declared in procedure division what care should be taken."
I did not really understand the question was not sure what exactly he wants to know, can someone here understands it and can guide.
Declaration Cursor location in DB2.
- Anuj Dhawan
- Founder
- Posts: 2816
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: Declaration Cursor location in DB2.
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.
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.
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
-
- Global Moderator
- Posts: 588
- Joined: Wed Nov 20, 2013 11:53 am
- Location: Mars
Re: Declaration Cursor location in DB2.
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
zprogrammer
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute