Hi,
If we declare the curosr in procedure division and if we declare it in WS Section, wil lthat make any difference in the two? If yes, what are the differneces.
DB2 Curosr declaration in procedure division and in WS Section.
-
- New Member
- Posts: 8
- Joined: Tue Jan 13, 2015 3:26 pm
- Anuj Dhawan
- Founder
- Posts: 2802
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: DB2 Curosr declaration in procedure division and in WS Section.
There is no difference in the two as far as the definition of the CURSOR is concerned. If you declare the CUROSR in PROCEDURE DIVISION, the OPEN should logically be done after the DECLARE.
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.
-
- New Member
- Posts: 8
- Joined: Tue Jan 13, 2015 3:26 pm
Re: DB2 Curosr declaration in procedure division and in WS Section.
Thanks Anuj. I knew that there is no difference but was not sure about the OPEN statement. Thanks for the clarification.
- Anuj Dhawan
- Founder
- Posts: 2802
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: DB2 Curosr declaration in procedure division and in WS Section.
For instance, consider CURSOR as a variable which you'll use in your program. In most of the languages, you can use the variable in the logic of the program later, only if it is declared somewhere before it is used. Same is the case with CURSOR, unless system has its definition, it won't recognize it.
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.
-
- New Member
- Posts: 8
- Joined: Tue Jan 13, 2015 3:26 pm
Re: DB2 Curosr declaration in procedure division and in WS Section.
You do not find such definitions in book. Thank you!Anuj Dhawan wrote:For instance, consider CURSOR as a variable which you'll use in your program. In most of the languages, you can use the variable in the logic of the program later, only if it is declared somewhere before it is used. Same is the case with CURSOR, unless system has its definition, it won't recognize it.
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