Timesten Pro*C Error : ORA-01002: Function sequence error (Doc ID 1344844.1)

Last updated on DECEMBER 20, 2015

Applies to:

Oracle TimesTen In-Memory Database - Version 11.2.1.7.1 and later
Information in this document applies to any platform.
***Checked for relevance on 25-Jun-2014***
***Checked for relevance on 21-Dec-2015***

Symptoms


Following block of Code exited with ORA -01002 Error

EXEC SQL DECLARE CUR1 CURSOR FOR
SELECT A.AC_BR, TO_CHAR(A.ODR_NO), TO_CHAR(A.CNTR_NO)
FROM TEST A
WHERE A.AC_BR = '999'
AND NVL(A.ERR_OCUR_YN,'N') = 'N'
ORDER BY A.SEQ;

EXEC SQL OPEN CUR1;
while(1)
{
EXEC SQL FETCH CUR1 INTO
:f_acbr, :l_odr_no, :l_cntr_no;
if (sqlca.sqlcode == 1403) break;
if ((sqlca.sqlcode != 0) && (sqlca.sqlcode != -1405))
{
EXEC SQL CLOSE CUR1;
return -1;
}
cnt ++;

EXEC SQL EXECUTE
DECLARE
BEGIN
UPDATE TEST
SET ERR_OCUR_YN = 'Y', ERR_MSG = 'test'
WHERE AC_BR = :f_acbr
AND ODR_NO = :l_odr_no
AND CNTR_NO = :l_cntr_no;
COMMIT;
END;
END-EXEC;
}

EXEC SQL CLOSE CUR1;
exit(0);



ERROR CODE : -1002
ERROR MESSAGE : ORA-01002: Function sequence error

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms