IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

A question on Cursor.


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Mukesh Pandey

Active User


Joined: 11 Nov 2008
Posts: 143
Location: India

PostPosted: Mon Jan 18, 2010 3:15 pm
Reply with quote

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
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Mon Jan 18, 2010 3:25 pm
Reply with quote

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
View user's profile Send private message
Mukesh Pandey

Active User


Joined: 11 Nov 2008
Posts: 143
Location: India

PostPosted: Mon Jan 18, 2010 3:42 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Jan 18, 2010 3:45 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Question for file manager IBM Tools 7
No new posts question for Pedro TSO/ISPF 2
No new posts question on Outrec and sort #Digvijay DFSORT/ICETOOL 20
No new posts panel creation question TSO/ISPF 12
No new posts Sort w/OUTREC Question DFSORT/ICETOOL 2
Search our Forums:

Back to Top