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
 
SQL-status-code to know wheter the cursor is opened or not

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

New User


Joined: 28 Aug 2005
Posts: 3

PostPosted: Wed Sep 06, 2006 1:29 pm    Post subject: SQL-status-code to know wheter the cursor is opened or not
Reply with quote

When we open cursor and process some statements and call other programs, sometimes the cursor may get closed even before closing the cursor explicitely.

If the cursor is closed, then we can open the cursor again.

For this, I would like to know whether we have any option to know the cursor is still opened OR closed i.e. the status of the cursor.

Note: I can not use the SQL-status-code to know wheter the cursor is opened or not. It is because I will process many SQL statements in between. So the SQL-status-code will show the status of last processed SQL statement.
Back to top
View user's profile Send private message

DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Wed Sep 06, 2006 7:45 pm    Post subject: Re: SQL-status-code to know wheter the cursor is opened or n
Reply with quote

What condition is causing the cursor to close? There should be a way around this. Having to re-open and re-position youself in the cursor is pretty costly.

Dave
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Fri Sep 08, 2006 9:13 am    Post subject: Re: SQL-status-code to know wheter the cursor is opened or n
Reply with quote

Quote:
For this, I would like to know whether we have any option to know the cursor is still opened OR closed i.e. the status of the cursor.

I would could another OPEN CURSOR statement where you want to check & if getting -502 things are fine else if +000 It is opened again; rest all ABEND.
Quote:
Note: I can not use the SQL-status-code to know wheter the cursor is opened or not. It is because I will process many SQL statements in between. So the SQL-status-code will show the status of last processed SQL statement.

I dont understand this. Why cant you use SQLCODE. Number of times you are executing any SQL statement you'll get an SQLCODE.
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Fri Sep 08, 2006 9:21 pm    Post subject: Re: SQL-status-code to know wheter the cursor is opened or n
Reply with quote

Narasimha_chintu,

Come back and let us know if you have a resolution to your problem.

If not it could be as simple as adding 'WITH HOLD' to you Cursor.

Check the link below to the DB2 Manual


DECLARE CURSOR

Dave
Back to top
View user's profile Send private message
tanky

New User


Joined: 19 Jun 2006
Posts: 1

PostPosted: Fri Sep 08, 2006 9:59 pm    Post subject:
Reply with quote

hEY

I Dont think is there any way get away from it icon_razz.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 GG return code abdulrafi IMS DB/DC 2 Tue Apr 10, 2018 12:31 pm
No new posts Find a string in PS file opened in br... mukkas CLIST & REXX 3 Sat Feb 24, 2018 2:15 pm
No new posts OLDS frozen in BACKOUT status when On... lind sh IMS DB/DC 3 Tue Feb 13, 2018 7:12 pm
No new posts IMS error U4038 while executing my PL... abdulrafi IMS DB/DC 2 Thu Feb 08, 2018 1:05 pm
No new posts Conditional setting of return-code af... sanvan COBOL Programming 9 Wed Jan 31, 2018 11:05 pm

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