View previous topic :: View next topic
|
Author |
Message |
Mukesh Pandey
Active User
Joined: 11 Nov 2008 Posts: 143 Location: India
|
|
|
|
A query returns sql code of 100 in QMF.
What will happen when a program is trying to open the cursor for the same query.
Thanks, |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Mukesh,
What do you think? What should happen? When ur program issues Open statement db2 process the Select stmt that defined in Declare cursor & store the result in Result Table. So in this case Result table will contain 0
records |
|
Back to top |
|
|
Mukesh Pandey
Active User
Joined: 11 Nov 2008 Posts: 143 Location: India
|
|
|
|
guptae.. this is an interview question.. my answer was the cursor will open but will fail while fetch returning sqlcode 100. please correct me if i am wrong. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
the OPEN will return a sqlcode of 000, if you don't have any errors, but a result table of zero rows will return an sqlcode of 000.
your first FETCH (if the result table consists of zero rows) will return an sqlcode of +100. |
|
Back to top |
|
|
|