Learning SQLRPGLE in AS/400

845 pts.
Tags:
AS/400
SQLRPGLE
Hi,
I am looking for something where I can learn SQLRPGLE & Stored procedures in AS/400. I tried with few few sites, but none of them are clear. Kindly let me know, where I can get some programming knowledge on SQLRPGLE procedures.


Software/Hardware used:
iseries

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 8  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • philpl1jb

    These are two pretty big subjects. 

    Look for one at a time. 

    Do you know SQL???

    50,425 pointsBadges:
    report
  • HABBIE
    Yes. I know SQL, I am familiar with all the concepts. 
    845 pointsBadges:
    report
  • philpl1jb
    50,425 pointsBadges:
    report
  • philpl1jb

    but when you say you know SQL .. it brings me off topic to this:

    Dere’s no guy livin’ dat knows Brooklyn t’roo an’ t’roo, because it’d take a guy a lifetime just to find his way aroun’ duh goddam town.

    Only The Dead Know Brooklyn by Thomas Wolfe
    50,425 pointsBadges:
    report
  • HABBIE
    Hi philp,

    I have written some thing on SQLRPGLE. I am facing few issues.I request you to kindly look at the code & let me know the mistakes.Please forgive me ,If I made any blunders on this. 

    This is my file.

    0001.00                 R EMP                            
    0002.00                   NAME          10A              
    0003.00                   ID             7S 0            
    0004.00                   GRADE          1A              
    0005.00                   TENURE         5S 0            
    0006.00                   ADDRESS        7A              
    0007.00                   SEPT           5A              
            ****************** End of data ******************

    My SQLRPGLE program:

    0001.00 DMYDS             DS            50                                   
    0002.00 DNAME                     1     10A                                  
    0003.00 DID                      12     18S 0                                
    0004.00 DGRADE                   20     21A                                  
    0005.00 DTENURE                  23     27S 0                                
    0006.00 DADDRESS                 29     35A                                  
    0007.00 DSEPT                    37     41A                                  
    0008.00 DSEARCHID         S                   LIKE(ID)                       
    0009.00 C/EXEC SQL                                                           
    0010.00 C+ DECLARE C1 DYNAMIC SCROLL CURSOR WITH HOLD FOR SELECT             
    0011.00 C+ NAME,ID,GRADE,TENURE,ADDRESS,SEPT FROM FILE1 WHERE ID=:SEARCHID   
    0012.00 C/END-EXEC                                                           
    0013.00 C/EXEC SQL                                                           
    0014.00 C+ OPEN C1                                                           
    0015.00 C/END-EXEC                                                           
    0016.00 C/EXEC SQL                                                           
    0017.00 C+ FETCH NEXT FROM C1 INTO :MYDS                                     
    0018.00 C/END-EXEC                                                           
    0019.00 C                   DOW       SQLSTATE='00000'                      
    0020.00 C     MYDS          DSPLY                                             
    0021.00 C/EXEC SQL                                                            
    0022.00 C+ FETCH NEXT FROM C1 INTO :MYDS                                      
    0023.00 C/END-EXEC                                                            
    0024.00 C                   ENDDO                                             
    0025.00 C/EXEC SQL                                                            
    0026.00 C+ CLOSE C1                                                           
    0027.00 C/END-EXEC                                                            
    0028.00 C                   SETON                                        LR   
            ****************** End of data ***************************************

    This is my procedure code:
    CREATE PROCEDURE TWILIGHT1/PROC11(IN :SEARCHID DEC (7 , 0)) RESULT  
    SETS 1 LANGUAGE RPGLE NOT DETERMINISTIC CONTAINS SQL EXTERNAL NAME  
    TWILIGHT1/PGM3 PARAMETER STYLE GENERAL                          

    When I am trying to call procedure It is showing

    CALL TWILIGHT1/PROC11 (13)
    CALL statement complete.  

    This is the error from DSPJOBLOG.

    Reading SQL data not permitted.
    Cursor C1 not open.            
    Cursor C1 not open.            

    I will be thank full, kindly help me on this
     This is my first try with SQLRPGLE.
    845 pointsBadges:
    report
  • philpl1jb

    1.  Your data structure isn't spaced correctly but much simplier to use this command to create the structure and bring the field structure in

    0001.00 DMYDS           E DS                extname(FILE1)

    But that wouldn't create the error you reported.  The open C1 has apparently failed.  And that means a problem in the Declare 

    I would put a dump after the open and then check the dump for SQLCode and SQLState and everything else in that block of labels..your problem will be more apparent if you do that.

     

    50,425 pointsBadges:
    report
  • HABBIE
    Thanks for ur response Philp.
    As u said I kept the dump & viewed the dump file. I can't find any thing from it, as I am unable to understand those codes.
    845 pointsBadges:
    report
  • Splat
    7,425 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following