× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Detecting an open SQL cusor?
  • From: "David Morris" <dmorris@xxxxxxxxxxxxx>
  • Date: Thu, 06 Aug 1998 11:56:54 -0600

David,

I assume you are using dynamic SQL with a prepare.  If you are we do something 
like the following:

Build select statement then -

C                   DOU       SQLCOD     <> -519                           No 
Cursor open.
C*
C                   IF        SQLCOD      = -519                           
Cursor was open.
C                   EXSR      SubClsCsr                                    
Close cursor.
C                   END                                                    
SQLCOD=-519
C*
C                   EXSR      SubPreSel                                    
Prepare select.
C                   ENDDO                                                  
SQLCOD<>-519

If using SQLDA allocate memory while using describe.

Open the cursor.

David Morris

>>> "David Gibbs" <david.gibbs@silvon.com> 08/06 8:38 AM >>>
Folks:

Does anyone know if there is a way to detect an open SQL cusor in an 
ILE RPG program?

I have a program that reads a record and exits leaving the SQL cusor 
open (subsequent records are read future calls, that's why the cursor 
is left open).

Occasionally, I have to close the cusor to select different 
records... but I would like to avoid the "Cursor xxx is not open" 
diagnostic message that gets put in the job log (my boss is a 
stickler for not having diag & escape messages in the joblog).

So, I'm looking to find a way to determine if a cursor is open before 
I try to close it.

TIA!

david

--

David Gibbs
Sr. Software Engineer
Mortice Kern Systems US, Inc.
900 Oakmont Ln, Suite 400
Westmont, IL  60559
DID: (630) 734-5479
http://www.mks.com 
mailto:david.gibbs@silvon.com 

Opinions expressed are strictly my own and do 
not necessarily reflect those of my employer

You'll only see your obstacles each time you take 
     your eyes off of your goal! 

                   -- DMRoth


+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.