Duration of temporary tables

The duration of a temporary table depends on whether or not it is logged.

A logged temporary table exists until one of the following events occurs:
  • The application disconnects.
  • The DROP TABLE statement is issued on the temporary table.
  • The database is closed.

When any of these events occurs, the temporary table is deleted.

Nonlogging temporary tables include tables that were created using the WITH NO LOG option of CREATE TEMP TABLE.

A nonlogging temporary table exists until one of the following situations occurs:
  • The application disconnects.
  • The DROP TABLE statement is issued on the temporary table.
  • The database is closed, and the nonlogging temporary table includes at least one column of a user-defined type, or of a built-in opaque data type. (The HCL OneDB™ built-in opaque data types include BLOB, BOOLEAN, BSON, CLOB, JSON, LVARCHAR, and IDSSECURITYLABEL.)

If the nonlogging temporary table does not include any columns of UDTs or of built-in opaque data types, you can use that table to transfer data from one database to another while the application remains connected, because the table is not destroyed when the database is closed. You must use a permanent table (or some other strategy) if the data to be transferred includes UDTs or built-in opaque data types.