RelationalDBDesign RelationalDBDesign


SQL*Loader   «Prev 

Creating a Temporary Table

CREATE GLOBAL TEMPORARY TABLE tablename
(column specifications)
ON COMMIT (DELETE ROWS | PRESERVE ROWS)

CREATE GLOBAL TEMPORARY TABLE PHONE_BILLING
(CUSTOMER_ID NUMBER,
 BILLING_PERIOD VARCHAR2(20),
 TRANSACTION_DATE DATE,
 TRANSACTION_TYPE VARCHAR2(10),
 DURATION NUMBER,
 CHARGE_AMOUNT NUMBER,
 TAX_AMOUNT NUMBER)
ON COMMIT PRESERVE ROWS;

Location 1 DELETE ROWS means that the Oracle will truncate the table (all rows are deleted) after each commit.
Location 2 PRESERVE ROWS means that Oracle will not truncate the table until the end of the session.

Managing Temporary Tablespace for Temporary LOBs

Temporary tablespace is used to store temporary LOB data. As a database administrator you control data storage resources for temporary LOB data by controlling user access to temporary tablespaces and by the creation of different temporary tablespaces.