View previous topic :: View next topic
|
Author |
Message |
sarangwagh7
New User
Joined: 15 Mar 2007 Posts: 13 Location: Pune
|
|
|
|
I am using the cursor in my Program.
So if the Table is locked on which i have declared the cursor, the error should be at "Opening Cursor"
But i am getting error while Fetching the Cursor.
It gets successfully open even if the Table is lock.
Please explain the scenario. |
|
Back to top |
|
|
vini_srcna
Active User
Joined: 26 May 2005 Posts: 178 Location: Copenhagen, Denmark
|
|
|
|
Can you post the query here..? Is there any host variable in the query..?
Is the vaule supplied to the host variable before opening the cursor..? |
|
Back to top |
|
|
sarangwagh7
New User
Joined: 15 Mar 2007 Posts: 13 Location: Pune
|
|
|
|
The embbeded fetch query has host variable.
Code: |
EXEC SQL
FETCH NN00-CUR
INTO :NN00-TRAN-IND,
:NN00-DNM-ITEM-CDE,
:NN00-TRAN-TYP-CDE
END-EXEC |
My doubt is, if the table is locked, then the cursor should not get open
it should give SQLCODE not equal to 0
But its getting open successfully and giving error at the time of fetch. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
And how is the table locked? |
|
Back to top |
|
|
Lkmi
New User
Joined: 04 Mar 2005 Posts: 53 Location: Newyork
|
|
|
|
opening of cursor actually just points to the data...it doesnt try 2 get the data...fetch is when the data is fetched..tht might be the reason for the error during fetch instead of open. |
|
Back to top |
|
|
sarangwagh7
New User
Joined: 15 Mar 2007 Posts: 13 Location: Pune
|
|
|
|
Thanks LK |
|
Back to top |
|
|
Lkmi
New User
Joined: 04 Mar 2005 Posts: 53 Location: Newyork
|
|
|
|
No..probs...welcome... |
|
Back to top |
|
|
|