View previous topic :: View next topic
|
Author |
Message |
Dhrubojoty mukherjee
New User
Joined: 23 Mar 2010 Posts: 14 Location: kolkata
|
|
|
|
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 |
|
|
chandan.inst
Active User
Joined: 03 Nov 2005 Posts: 275 Location: Mumbai
|
|
|
|
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 |
|
|
Dhrubojoty mukherjee
New User
Joined: 23 Mar 2010 Posts: 14 Location: kolkata
|
|
|
|
Thanks Chandan for your reply. But I just want to know when it gets SQL code +354.. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
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 |
|
|
Dhrubojoty mukherjee
New User
Joined: 23 Mar 2010 Posts: 14 Location: kolkata
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
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 |
|
|
chandan.inst
Active User
Joined: 03 Nov 2005 Posts: 275 Location: Mumbai
|
|
|
|
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 |
|
|
Dhrubojoty mukherjee
New User
Joined: 23 Mar 2010 Posts: 14 Location: kolkata
|
|
|
|
Thanks a ton ...Chandan.... |
|
Back to top |
|
|
|