View previous topic :: View next topic
|
Author |
Message |
ksikdar
New User
Joined: 30 Jun 2006 Posts: 13
|
|
|
|
Hi all,
Please tell me what will happen if a cursor is defined in procedure division instead of declaring in working storage section of data division??? |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi There,
It 's wont effect whether the cursor is declared in working storage or procedure division but it should be declare befor open cursor stmt.
Please use search option befor posting a new thread |
|
Back to top |
|
|
ksikdar
New User
Joined: 30 Jun 2006 Posts: 13
|
|
|
|
This question was asked in an interview in IBM.........Is it the corect answer??? |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi There,
No I am kidding
Quote: |
Is it the corect answer??? |
What do u mean by this? |
|
Back to top |
|
|
prav_06 Warnings : 1 Active User
Joined: 13 Dec 2005 Posts: 154 Location: The Netherlands
|
|
|
|
guptae,
If ya decalring the cursor in w-s section can u call the cursor for multiple times, but instd if ya declare the cursor in PD it can be called many times.
Example From a file i am getting the Account number, and from the same i am obtaining the transaction info. for the day from the database and printing the transaction info and this process is done for n no. of records from the input file. so when the account number changes my values inside the cursor also changes, an i need to close the cursor and reopen with new value being moved to a host vaiable in the where clause of the cursor.
Thamilzan.
Thamilzan. |
|
Back to top |
|
|
|