Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 213
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: 213
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 about dfsms management clas... Hervey Martinez IBM Tools 0 Tue Oct 10, 2017 6:19 pm
No new posts Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
No new posts Question related to Data dictionary f... rexx77 SYNCSORT 3 Thu Aug 31, 2017 7:23 am
No new posts Need DB2 query to fetch previous row ! Chandan1993 DB2 10 Sat Jun 03, 2017 10:43 am
No new posts QUESTION: RETURN CHANNEL pahiker CA Products 21 Thu Apr 20, 2017 12:31 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us