14 May 2018        Add to Favorites   Report

Create volatile table in Teradata

Volatile table is a temporary table to store the results. It will live till the session ends. Volatile tables uses spool space for storage.

Syntax:

CREATE VOLATILE TABLE Emp_Details
(
EMP_ID INTEGER TITLE 'EMPLOYEE ID',
EMP_NAME VARCHAR(50) NOT NULL,
EMP_AGE SMALLINT NULL,
EMP_DOB DATE
) WITH DATA
PRIMARY INDEX PI_INDEX(EMP_ID) ON COMMIT PRESERVE ROWS;

Note: the Primary index is optional in a volatile table. Also do not specify the database name while creating a volatile table


Copied