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


nVector

posted on 14 May 18

Enjoy great content like this and a lot more !

Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds