Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Opening Cursor when Table is locked

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

New User


Joined: 15 Mar 2007
Posts: 13
Location: Pune

PostPosted: Fri Mar 16, 2007 12:23 pm    Post subject: Opening Cursor when Table is locked
Reply with quote

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
View user's profile Send private message

vini_srcna

Active User


Joined: 26 May 2005
Posts: 178
Location: Copenhagen, Denmark

PostPosted: Fri Mar 16, 2007 1:14 pm    Post subject:
Reply with quote

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
View user's profile Send private message
sarangwagh7

New User


Joined: 15 Mar 2007
Posts: 13
Location: Pune

PostPosted: Fri Mar 16, 2007 5:19 pm    Post subject:
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Mar 16, 2007 5:53 pm    Post subject:
Reply with quote

And how is the table locked?
Back to top
View user's profile Send private message
Lkmi

New User


Joined: 04 Mar 2005
Posts: 53
Location: Newyork

PostPosted: Sat Mar 17, 2007 12:58 am    Post subject:
Reply with quote

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
View user's profile Send private message
sarangwagh7

New User


Joined: 15 Mar 2007
Posts: 13
Location: Pune

PostPosted: Tue Mar 20, 2007 11:53 am    Post subject:
Reply with quote

Thanks LK
Back to top
View user's profile Send private message
Lkmi

New User


Joined: 04 Mar 2005
Posts: 53
Location: Newyork

PostPosted: Tue Mar 20, 2007 6:20 pm    Post subject: Re: Opening Cursor when Table is locked
Reply with quote

No..probs...welcome... 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 Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us