SQLRPGLE Cursor not open error

810 pts.
Tags:
SQLRPGLE
Hi,
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.

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: 3  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
  • hunshabbir7
    I think this post is related to your issue.
    935 pointsBadges:
    report
  • philpl1jb

    Guess my answer from yesterday got lost.

    Cursor C1 not open.    

    This means that the open is failing .. and that means the select SQL has an error.

    I would put a dump after the open.

    Run the program.  If the same error occurs you want to inspect the dump SQLCode, SQLState and other SQL variables.  In there you will find a more complete description of the error and the code and state of the error.  Then you will be able to solve the error.

    49,550 pointsBadges:
    report
  • HABBIE
    Hi philp,

    Now I am able to open the cursor & it is showing nothing from the CALL statement.I can see nothing from the DSPJOBLOG also. I request you to kindly go through the link please

    http://itknowledgeexchange.techtarget.com/itanswers/sqlrpgle-program-results-nothing/

    Thanks

    810 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