View previous topic :: View next topic |
Author |
Message |
Maximus Beginner
Joined: 17 Nov 2005 Posts: 21 Topics: 11
|
Posted: Wed Mar 22, 2006 5:22 am Post subject: DB2 Cursors |
|
|
What will be the error code, if the the query in the decalre cursor doesn't returns any value when we open the cursor?
Thanks
Max |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed Mar 22, 2006 5:36 am Post subject: |
|
|
Maximus,
You will not get an error code as the open statement does not care if there are any result set rows.
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
Maximus Beginner
Joined: 17 Nov 2005 Posts: 21 Topics: 11
|
Posted: Wed Mar 22, 2006 5:56 am Post subject: |
|
|
Thanks Kolusu.
Suppose if we perform fetch operation on the same cursor after open? What would be the error code??
Whether it will be +100.
Kindly confirm this.
Thanks
Max |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed Mar 22, 2006 5:59 am Post subject: |
|
|
Maximus,
yes you would get a sqlcode of +100 upon the first fetch if the result set is empty.
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
Maximus Beginner
Joined: 17 Nov 2005 Posts: 21 Topics: 11
|
Posted: Wed Mar 22, 2006 7:40 am Post subject: |
|
|
Thanks Kolusu.
Max |
|
Back to top |
|
 |
raam_narayan Beginner
Joined: 28 Apr 2006 Posts: 12 Topics: 2
|
Posted: Wed May 03, 2006 4:35 am Post subject: |
|
|
Hi,
The basic thing u should understand is that when u r using the Cursor there are 4 operations which is involved.. i.e. Declare,open,Fetch and close.. Ur question states that what would be the SQL CODE when decalre cursor doesn't returns any value when we open the cursor.. There will not any SQLCODE because the Declare Cursor statement is not the executable statment...ONly if the OPen has any issue or if u r trying to fetch and that's got any issue u wuld be getting the SQLCODE +100 if all the rows had been fetched or if there is no result set also.. i hope this wud have made u clear.. if anymore queries pls get back to me...
Thanks & Regards,
V.Ram NArayan |
|
Back to top |
|
 |
|
|