Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
This topic is locked: you cannot edit posts or make replies. Natural ADABAS Opening with CTS enikhilk Mainframe Jobs 0 Wed Nov 30, 2016 5:37 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm
This topic is locked: you cannot edit posts or make replies. Job Opening for 3 to 10 yrs exp. in I... princeaggarwal Mainframe Jobs 0 Sat Aug 20, 2016 3:17 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us