Temporary Table
A Temporary Table that is treated as “VIEW” can be used in a procedure. You can refer, insert, update, or delete records in temporary tables.
Temporary tables are affected by transactions. When current transaction is rolled back, the records that saved at the previous commit are restored.
Declare Temporary Table
Declare Empty Table
DECLARE table_name VIEW (column_name [, column_name ...]);
- table_name
- identifier
- column_name
- identifier
Declare from the Result-Set of a Select Query
DECLARE table_name VIEW [(column_name [, column_name ...])] AS select_query;
- table_name
- identifier
- column_name
- identifier
- select_query
- Select Query
Dispose Temporary Table
DISPOSE VIEW table_name;
- table_name
- identifier