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 Getting -504 Cursor Name GTT-ARTS-CUR... Robin Sulsona DB2 2 Fri Mar 17, 2017 1:43 am
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm
No new posts Release of Adabas Cursor mohitsethi All Other Mainframe Topics 1 Mon Feb 06, 2017 8:36 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am


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