15 pts.
 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)
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?

Software/Hardware used:
ASKED: April 24, 2009  11:29 AM
UPDATED: April 24, 2009  2:15 PM

Answer Wiki:
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 ?
Last Wiki Answer Submitted:  April 24, 2009  2:15 pm  by  Technowise   290 pts.
All Answer Wiki Contributors:  Technowise   290 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _