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
 

 

DB2 Multi row fetch

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

New User


Joined: 23 Mar 2010
Posts: 14
Location: kolkata

PostPosted: Mon Nov 11, 2013 11:45 pm    Post subject: DB2 Multi row fetch
Reply with quote

What will be the SQL code at the last rowset fetch in case of multirow fetch in DB2. And exactly when it'll get SQL Code 100..
Back to top
View user's profile Send private message

chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 269
Location: Mumbai

PostPosted: Tue Nov 12, 2013 11:34 am    Post subject: Reply to: DB2 Multi row fetch
Reply with quote

Hi,

I will try to explain with an example.

Suppose you have a select query which will fetch around 250 rows and you have an cursor associated with query which is multi-fetch cursor with rowset positioning for 100 rows.

In such case you will get sqlcode 100 for the third fetch.

For first two fetches it will retrieve 100 rows each along with sqlcode 0 and third fetch will return only 50 rows along with sqlcode 100.

Hope this helps

Regards,
Chandan
Back to top
View user's profile Send private message
Dhrubojoty mukherjee

New User


Joined: 23 Mar 2010
Posts: 14
Location: kolkata

PostPosted: Tue Nov 12, 2013 7:58 pm    Post subject: Reply to: DB2 Multi row fetch
Reply with quote

Thanks Chandan for your reply. But I just want to know when it gets SQL code +354..
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Nov 12, 2013 8:15 pm    Post subject:
Reply with quote

Hello,

Why did you not mention the +354 originally?

We can't help much if you don't post the question you want answered . . .
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1278
Location: Belgium

PostPosted: Tue Nov 12, 2013 8:24 pm    Post subject:
Reply with quote

when some rows have warnings
Warnings like
+802 if you fetch colA / colB and sometimes colB is zero.
+445 Truncation has occured
...
Back to top
View user's profile Send private message
Dhrubojoty mukherjee

New User


Joined: 23 Mar 2010
Posts: 14
Location: kolkata

PostPosted: Wed Nov 13, 2013 11:04 pm    Post subject:
Reply with quote

So when some one gets sql code +354, it warns that it is the last row set fetch.And at the next row set fetch it'll get 100.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Wed Nov 13, 2013 11:07 pm    Post subject:
Reply with quote

Dhrubojoty mukherjee wrote:
So when some one gets sql code +354, it warns that it is the last row set fetch.And at the next row set fetch it'll get 100.

No.
Back to top
View user's profile Send private message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 269
Location: Mumbai

PostPosted: Thu Nov 14, 2013 11:59 am    Post subject: Reply to: DB2 Multi row fetch
Reply with quote

Though Guyc is already explained let me try to explain again and I would suggest you to refer manuals.

This is what manual says for + 354
+354
A ROWSET FETCH STATEMENT MAY HAVE RETURNED ONE OR MORE ROWS OF DATA. HOWEVER, ONE OR MORE WARNING CONDITIONS WERE ALSO ENCOUNTERED. USE THE GET DIAGNOSTICS STATEMENT FOR MORE INFORMATION REGARDING THE CONDITIONS THAT WERE ENCOUNTERED


Lets say you are fetching 100 rows in a fetch and out of 100 rows around 10 rows has any sql error or warning then you will get +354

Hope its clear now

Regards,
Chandan
Back to top
View user's profile Send private message
Dhrubojoty mukherjee

New User


Joined: 23 Mar 2010
Posts: 14
Location: kolkata

PostPosted: Thu Nov 14, 2013 9:09 pm    Post subject:
Reply with quote

Thanks a ton ...Chandan.... icon_biggrin.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 Multi row fetch - "for read only... Nileshkul DB2 3 Sun Aug 14, 2016 12:52 am
No new posts Reading selected volumes of a multi-v... RickBig JCL & VSAM 6 Wed Jul 13, 2016 7:26 pm
No new posts JCL to fetch schedule status from act... parasmalik20 CA Products 1 Thu Jun 02, 2016 7:11 pm
No new posts ABEND due to FETCH FAILED jackzhang75 ABENDS & Debugging 17 Thu Mar 10, 2016 3:08 am
No new posts Sort Query to fetch particular records RahulG31 DFSORT/ICETOOL 13 Fri Mar 04, 2016 8:17 pm


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