Start of change

-526   THE REQUESTED OPERATION OR USAGE DOES NOT APPLY TO table-type TEMPORARY TABLE table-name

Explanation

DB2® assumes that the SQL statement being executed refers to a created or declared temporary table, named table-name, and the requested operation or usage in the statement is not allowed on the temporary table.
table-type
CREATED or DECLARED

CREATED is for a temporary table defined by the CREATE GLOBAL TEMPORARY TABLE statement.

DECLARED is for a temporary table defined by the DECLARE GLOBAL TEMPORARY TABLE statement.

table-name
Qualified name of the temporary table.
  • If the SQL statement is a DELETE statement that specifies the fetch-clause, remove the fetch-clause from the DELETE statement.

System action

The statement cannot be processed.

Programmer response

Modify the SQL statement to ensure that the object references are not to the indicated type of temporary table

If table-type is DECLARED and you intended table-name to refer to an existing persistent base table, you must perform one of the following actions:
  • Recreate the persistent base table table-name with a different schema qualifier
  • In the same application process, issue a DROP TABLE for table name followed by a COMMIT to drop the declared temporary table and afterwards be able to reference the persistent base table with the same table-name in the same application process
  • Remove the DECLARE GLOBAL TEMPORARY TABLE statement from the application process to use the persistent base table with the same table-name

SQLSTATE

42995

End of change