Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Question regarding multi row fetch in DB2

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
bipinpeter

Active User


Joined: 18 Jun 2007
Posts: 210
Location: Cochin/Kerala/India

PostPosted: Mon Dec 07, 2009 7:17 pm    Post subject: Question regarding multi row fetch in DB2
Reply with quote

Hi All,
I declared a cursor for the multi row fetch
I am fetching like below.
Code:
 FETCH NEXT ROW SET CS1 FOR 10 ROWS INTO
:WS-A,
:WS-B;


My question is that.If in table there is only 5 rows present which is satisfying my criteria. Whats will be the SQLCODE which i will get.Is it 100? And alos will i get 5 rows in my WS-A, WS-B variables?
Back to top
View user's profile Send private message

Steve Davies

New User


Joined: 15 Oct 2009
Posts: 32
Location: UK

PostPosted: Mon Dec 07, 2009 7:27 pm    Post subject:
Reply with quote

Yes and yes. And to answer the next question you're about to ask....."How do I know how many rows the FETCH has returned?", you need to check the SQLCA field SQLERRD(3) which is populated after the FETCH with the number of rows that DB2 fetched.
Back to top
View user's profile Send private message
bipinpeter

Active User


Joined: 18 Jun 2007
Posts: 210
Location: Cochin/Kerala/India

PostPosted: Mon Dec 07, 2009 7:37 pm    Post subject:
Reply with quote

Thanks alot Steve for the quick reply icon_rolleyes.gif icon_razz.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts QUESTION: RETURN CHANNEL pahiker CA Products 21 Thu Apr 20, 2017 12:31 am
No new posts The Last Two Question For You To Ask ... CaptBill Mainframe Interview Questions 0 Fri Apr 14, 2017 5:42 am
No new posts Asynchronous CICS Processing Question moezbud CICS 1 Mon Mar 06, 2017 6:13 pm
No new posts CICS Question RE: Browse, Readnext an... moezbud CICS 7 Sun Mar 05, 2017 5:45 am
No new posts Multi row fetch - "for read only... Nileshkul DB2 3 Sun Aug 14, 2016 12:52 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us