12.22.2 How to define temporary tables and temporary table indexes

Organization of this subsection
(1) How to define temporary tables
(2) How to define temporary table indexes
(3) How to specify a temporary table RDAREA for storing data

(1) How to define temporary tables

Specify GLOBAL TEMPORARY in the CREATE TABLE definition SQL statement. To define a transaction-specific temporary table, specify ON COMMIT DELETE ROWS. To define an SQL session-specific temporary table, specify ON COMMIT PRESERVE ROWS. Note that for temporary tables, some operands are not allowed or are ignored if specified. For details, see CREATE TABLE in the manual HiRDB Version 9 SQL Reference.

(2) How to define temporary table indexes

The method is basically the same as when normal indexes are defined. For temporary table indexes, some operands are not allowed or are ignored if specified (as is the case with temporary tables). For details, see CREATE INDEX in the manual HiRDB Version 9 SQL Reference.

(3) How to specify a temporary table RDAREA for storing data

Specify in PDTMPTBLRDAREA in the client environment definition the name of a temporary table RDAREA that can be used. If you specify multiple RDAREAs or have omitted this environment definition, HiRDB determines the temporary table RDAREA to use for storing data according to the following rules:

Note that in an XDS client, the specification is assumed to be omitted because PDTMPTBLRDAREA is ignored.