Every now and then I'm getting an ORA-00942 when inserting to a global temporary table. Each time I verify the permissions and they are OK.
My DDL:
CREATE GLOBAL TEMPORARY TABLE GTT_GUIDE_SUBSCRIPTION (
SERVICE_SUBSCRIPTION_ID VARCHAR2(16) NOT NULL)
ON COMMIT DELETE ROWS;
My insert code snippet (C++ PROC*C):
EXEC SQL BEGIN DECLARE SECTION;
int iRowCount = 1;
char szBuffer[17];
EXEC SQL END DECLARE SECTION;
--------------------------------------
EXEC SQL FOR :iRowCount INTO GTT_GUIDE_SUBSCRIPTION VALUES(szBuffer);
Note: this isn't the first time I'm getting a strange ORA-00942 error, albeit not necessarily on a global temp table. I used to have it on a regular table. Mysteriously enough, what helped the problem was increasing the idle connection timeout. However, in this case the idle connection timeout is already longer than the process uptime when the error occurs.