Hello there,
I have optimized a complex Oracle statement using temporary table like this :
original :
SELECT data FROM table WHERE ..complex statement..;
optimized (I can't use WITH keyword, because I deal with < Oracle9i) :
CREATE GLOBAL TEMPORARY TABLE temptab (x NUMBER, y DATE) ON COMMIT DELETE ROWS;
INSERT INTO temptab SELECT * FROM temp;
SELECT data FROM temptab WHERE ..complex statement..;
COMMIT;
The problem is: I have to execute these statements on a new database. It is better to drop and create temporary table, or truncate it only if exists ? How can I deal with this additional table ?