Database: Oracle
Connection: ODBC
Compiler: NETEXPRESS 3.0
I am trying to open a cursor on a table in a database.
When the program runs, it skips the exec sql declare cursor and tries to execute the exec sql open cursor. Of course, this generates and error.
When I removed the declare cursor command and made it an exec sql select statement, the program ran and executed the exec sql.
Basically, the compiler does not like the DECLARE CURSOR.
This program ran before on MVS/DB2. Now it will run on NT/ORACLE, but it won't execute the declare.
The only directive I have is $set SQL. I open a connection using odbc, and all select statements are run.
Please help, as this is a major roadblock in going live with an implementation.
Code being skipped:
EXEC SQL DECLARE AG_GL_XREF_CUR CURSOR FOR
SELECT AG_ADP_FIELD_NAME
, AG_DEBIT_DIVISION
, AG_DEBIT_COST_CTR
, AG_DEBIT_GL_ACCT
, AG_DEBIT_ACCR_FLG
, AG_CREDIT_DIVISION
, AG_CREDIT_COST_CTR
, AG_CREDIT_GL_ACCT
, AG_CREDIT_ACCR_FLG
, AG_PAYROLL_DESC
, AG_ADP_CODE_VALUE
, AG_ADP_STATE_CD
, AG_ADP_SUI_CD
, AG_PERCENT
, PAYGROUP
FROM PS_AG_ADP_GL_XREF
WHERE PAYGROUP = S-CMPNY-CD
ORDER BY AG_ADP_FIELD_NAME
END-EXEC.
EXEC SQL OPEN AG_GL_XREF_CUR END-EXEC.
Thanks,
Erol
Connection: ODBC
Compiler: NETEXPRESS 3.0
I am trying to open a cursor on a table in a database.
When the program runs, it skips the exec sql declare cursor and tries to execute the exec sql open cursor. Of course, this generates and error.
When I removed the declare cursor command and made it an exec sql select statement, the program ran and executed the exec sql.
Basically, the compiler does not like the DECLARE CURSOR.
This program ran before on MVS/DB2. Now it will run on NT/ORACLE, but it won't execute the declare.
The only directive I have is $set SQL. I open a connection using odbc, and all select statements are run.
Please help, as this is a major roadblock in going live with an implementation.
Code being skipped:
EXEC SQL DECLARE AG_GL_XREF_CUR CURSOR FOR
SELECT AG_ADP_FIELD_NAME
, AG_DEBIT_DIVISION
, AG_DEBIT_COST_CTR
, AG_DEBIT_GL_ACCT
, AG_DEBIT_ACCR_FLG
, AG_CREDIT_DIVISION
, AG_CREDIT_COST_CTR
, AG_CREDIT_GL_ACCT
, AG_CREDIT_ACCR_FLG
, AG_PAYROLL_DESC
, AG_ADP_CODE_VALUE
, AG_ADP_STATE_CD
, AG_ADP_SUI_CD
, AG_PERCENT
, PAYGROUP
FROM PS_AG_ADP_GL_XREF
WHERE PAYGROUP = S-CMPNY-CD
ORDER BY AG_ADP_FIELD_NAME
END-EXEC.
EXEC SQL OPEN AG_GL_XREF_CUR END-EXEC.
Thanks,
Erol