× 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.



In the GDMENU2 program do you issue a close cursor statement??

c/exec sql
C+ close mycursor
c/end-exec


If  this is a Declare cursor statement why post only part of the SQL??

Thanks,
Tommy Holden


-----Original Message-----
From: rpg400-l-bounces+tommy.holden=hcahealthcare.com@xxxxxxxxxxxx
[mailto:rpg400-l-bounces+tommy.holden=hcahealthcare.com@xxxxxxxxxxxx] On
Behalf Of rob@xxxxxxxxx
Sent: Monday, October 31, 2005 12:21 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: Question about Cursors - SQLRPGLE

I saw that in the archives that
     C/EXEC SQL
     C+ Set Option
     C+     CloSqlCsr = *EndMod
     C/END-EXEC
was suggested.

It was also noted that sometimes even that doesn't work and a ALCOBJ
OBJ(xxx) CONFLICT(*RQSRLS) may be in order.

I think I am running into one of those situations.

SQL statement from GDMENU2
     C/EXEC SQL
     C+  select MANAM into :MANAM
     C+  from ZMA
     C+  where (MAID='MA' or MAID='GD')
     C+    and MAUSR=:USER
     C+    and (MANAM='SAMENU'
     C+        or MANAM='RAMENU'
     C+        or MANAM='SAMEN2'
     C+        or MANAM='RAMEN2')
     C+  fetch first row only
     C/END-EXEC

MENU3R1 calls
  GDMENUC calls
    GDMENU calls
      GDMENU2C calls
        GDMENU2
"Sometimes" exitting back to MENU3R1 leaves ZMA file locked.  Exitting
MENU3R1 back to command line frees up the lock.
GDMENU2 

When I run it in debug:
...
CPI4325-Temporary result file built for query. ...for reason code 13.
  13 - The query involves a static cursor or the SQL FETCH FIRST clause.
...
Upon exit of MENU3R1...
5 >  *SYSTEM/DSPJOB 
    Connection to relational database GDIHQ ended.
    SQL cursors closed. 

DSPPGM GDMENU2
Close SQL cursor . . . . . . . . . . . . . . . :   *ENDMOD

It's all in the same activation group.

Haven't tried the ALCOBJ yet.  Just wondering why I would need to.

Rob Berendt
--
Group Dekko Services, LLC
Dept 01.073
PO Box 2000
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





"Satheeshkumar_selvaraj" <Satheeshkumar_selvaraj@xxxxxxxxxx> 
Sent by: rpg400-l-bounces+rob=dekko.com@xxxxxxxxxxxx
10/25/2005 11:42 AM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


To
"RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>
cc

Fax to

Subject
Question about Cursors - SQLRPGLE






Hi All,

 

I am using cursor in my SQLRPGLE program.

I found that even after coming out of the program the file used in the
cursor holds the lock.

I am using CLOSE cursor statement in my program.

Is there any way to release this lock when the program ends? (in the
program itself).

 

-Satheesh



DISCLAIMER:
This email (including any attachments) is intended for the sole use of
the 
intended recipient/s and may contain material that is CONFIDENTIAL AND 
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying

or distribution or forwarding of any or all of the contents in this 
message is STRICTLY PROHIBITED. If you are not the intended recipient, 
please contact the sender by email and delete all copies; your
cooperation 
in this regard is appreciated.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.