Snippet Name: Temp table demo Description: Simple demo of Oracle temporary tables. Comment: (none) Language: PL/SQL Highlight Mode: PLSQL Last Modified: March 03rd, 2009
Description: Simple demo of Oracle temporary tables.
DROP TABLE x / CREATE global temporary TABLE x (a DATE) ON COMMIT DELETE rows -- Delete rows after commit -- on commit preserve rows -- Delete rows after exit session / SELECT table_name, temporary, duration FROM user_tables WHERE table_name = 'X' / INSERT INTO x VALUES (SYSDATE); SELECT * FROM x; COMMIT; -- Inserted rows are missing after commit SELECT * FROM x;