View previous topic :: View next topic
|
Author |
Message |
rohanatl
New User
Joined: 21 Oct 2005 Posts: 22
|
|
|
|
Hi,
1) i am using a db2 cursor in the program and in first section i have opened the cursor , and then perfoming another section to fetch the records till sqlcode=100
The question is
2) when we open the cursor will it positioned to the first record which matches the condition
3 ) If the table is empty or no records matching the condition then will it throw the sqlcode 100 while opening the cursor.....
Please help me to find the solution.........
Thanks
Rohan |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Quote: |
when we open the cursor will it positioned to the first record which matches the condition |
What do you mean by "which matches the condition"? Not exactly on first row while opening the cursor. But in first FETCH, the cursor will be on first row.
Quote: |
3 ) If the table is empty or no records matching the condition then will it throw the sqlcode 100 while opening the cursor..... |
No, while FETCHing only, SQLCODE 100 is thrown if there are no rows. |
|
Back to top |
|
|
rohanatl
New User
Joined: 21 Oct 2005 Posts: 22
|
|
|
|
HI thanks for ur replay
Quote: |
when we open the cursor will it positioned to the first record which matches the condition |
what I was suppposed to ask is ...we wil be having the select query in the cursor definition so if we open the cursor what actoin happens ..
i thought that if there is any records matches the condition in the query the cursor will
point to that particular record and then from there it will move to the next records based on the condition ...
Thanks
Rohan |
|
Back to top |
|
|
Prajesh_v_p
Active User
Joined: 24 May 2006 Posts: 133 Location: India
|
|
Back to top |
|
|
|