SQL in RPG (Error when TESTING (i.e. running under ISDB) RPG program which builds SQL statement and then uses PREPARE,DECLARE,OPEN,FETCH,CLOSE)

15 pts.
Tags:
RPG
SQL
SQL in RPG
SQL Testing
Under ISDB, JOBLOG showed' Internal Error 1001 has occurred SQLCOD -901' SQLCOD was ‘-901’ (i.e. minus 901) which according to manual ’SQL Programming’ is associated with Message SQL0901 – ‘SQL System Error’ SQLERP was ‘QSQROUTE’ - According to Manual ‘DB2 Universal Database for ISeries Appendix B SQL Comms Area’, SQLERP contains the name of the product and module returning the error (see Page 826). The first 3 characters identify the product (in this case ‘QSQ’ for ‘DB2 UDB for iSeries’ ) The Module is ‘ROUTE’ – but where are Modules explained ??????? And then advises to see ‘CONNECT (Type 1) (Page 417) or CONNECT (Type 2) (Page 422) SQLSTT was ‘58004’ - according to manual ‘SQL Messages and Codes’ the Meaning is ‘A system error (that does not preclude the successful execution of subsequent SQL statements) occurred’. 2 Questions Does this mean that the construct of the SQL statement I had attempted to build within RPG was incorrect in some way (syntactically or otherwise) or does the problem lie elsewhere? If elsewhere, where should I look?

Answer Wiki

Thanks. We'll let you know when a new response is added.

INVALID_CURSOR

ORA-01001 SQLCODE= -1001

You made reference to a cursor that did not exist. This usually happens when you try to FETCH from a cursor or CLOSE a cursor before that cursor is OPENed.

—————-

Can you post your SQL statement, so we can have a look ?

Discuss This Question:  

 
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

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