Professional Documents
Culture Documents
BEGIN
DECLARE LOCAL TEMPORARY TABLE t ( c1 INTEGER );
INSERT t VALUES ( 2 );
SELECT * FROM t; -- displays 2
END;
You can use DECLARE LOCAL TEMPORARY TABLE just like an executable
statement outside a compound statement. When you do that, the new table over-
rides any global permanent or global temporary table with the same name. Here
is an example that shows how DECLARE LOCAL TEMPORARY TABLE
overrides a global temporary table until the new table is explicitly dropped:
CREATE GLOBAL TEMPORARY TABLE t ( c1 INTEGER );
INSERT t VALUES ( 1 );
SELECT * FROM t; -- displays 1