Welcome to plsql4all.blogspot.com SQL, MYSQL, ORACLE, TERADATA, MONGODB, MARIADB, GREENPLUM, DB2, POSTGRESQL.

Saturday, 25 October 2014

Creating Volatile table in teradata

Volatile table is a table when you log out, table's definition and data gets vanished. It is like temporary tables except temporary tables definition remains in the data dictionary whereas volatile tables gets vanished.
Let's see how to create volatile table in teradata:-

CREATE VOLATILE TABLE VOL_TABLE_NAME
(
 COLUMN_NAME DATA_TYPE,
COLUMN_NAME DATA_TYPE,
COLUMN_NAME DATA_TYPE,
COLUMN_NAME DATA_TYPE,
.
.
)
ON COMMIT PRESERVE ROWS; 

Note:- When you are creating volatile table and forget to mention ON COMMIT PRESERVE ROWS then you would not be able to see the data as teradata create volatile table as ON COMMIT DELETE ROWS by default. So, work accordingly as per your requirement.


No comments:

Post a Comment

Please provide your feedback in the comments section above. Please don't forget to follow.