× 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: Embedded SQL lock record
  • From: "Simmerlein, Stefan" <S.Simmerlein@xxxxxxxxxxx>
  • Date: Fri, 30 Mar 2001 10:26:54 +0200

Title: Embedded SQL lock record

Hi,

i have some problems with sql. We have a rpg-servicepgm. with a
sql-procedure using the sqlda. With this procedure i can execute
SELECT, INSERT, UPDATE Statements.

If i call my procedure with a normal SELECT statement the sql
locks the record. That's a problem, because after
calling the sql-procedure i make a chain and update operation
on the same file.

How can i use my procedure without lock the record ?
Can i say unlock in the prepare or in the fetch statements ?

thx for help, stefan


some statements of my sql-procedure:
...
..
...


 c                   if        %subst(statement:1:6) = 'SELECT'                   
                           
 c/exec sql include sqlda                                                            
 c/end-exec                                                                          
 c/exec sql prepare s0 from :statement                                               
 c/end-exec                                                                          
 c                   eval      sqln = 50                                             
 c/exec sql describe s0 into :sqlda                                                  
 c/end-exec                                                                          
 c                   if        sqln <= sqld                                          
 c                   eval      sqln = sqld                                           
 c/exec sql describe s0 into :sqlda                                                  
 c/end-exec                                                                          
 c                   endif                                                           
 c/exec sql declare c0 cursor for s0                                                 
 c/end-exec                                                                          
 c/exec sql open c0                                                                  
 c/end-exec                                                                          
 c                   eval      #PrepareError = (SQLCOD < 0)                          
 c                   endif  

...
...
...
...
...


c              if        %subst(statement:1:6) = 'SELECT'
  
c/exec sql                                                            
c+ fetch c0 for 1 rows                                                
c+ using descriptor :sqlda                                            
c+ into :satz_ds                                                      
c/end-exec                                                            
c                else                                              
       
c/exec sql prepare s0 from :statement                           
c/end-exec                                                       
c/exec sql                                                       
c+ execute s0                                                     
c/end-exec                                                        
c               eval      #PrepareError = (SQLCOD < 0)       
c               endif                                             







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.