oracle global temporary tables
Posted
by mrp
on Stack Overflow
See other posts from Stack Overflow
or by mrp
Published on 2010-04-22T14:24:20Z
Indexed on
2010/04/22
14:33 UTC
Read the original article
Hit count: 443
I created the global temp table. when I execute the code as an individual scripts it works fine. but when I execute it as a single script in TOAD then no record was created. there was just an empty global temp table.
eg.
CREATE GLOBAL TEMPORARY TABLE TEMP_TRAN
(
COL1 NUMBER(9),
COL2 VARCHAR2(30),
COL3 DATE
) ON COMMIT PRESERVE ROWS
/
INSERT INTO TEMP_TRAN VALUES(1,'D',sysdate);
/
INSERT INTO TEMP_TRAN VALUES(2,'I',sysdate);
/
INSERT INTO TEMP_TRAN VALUES(3,'s',sysdate);
/
COMMIT;
When I run the above code one statement at a time it works fine. But when I execute it as a script it runs fine but there was no records in temp table.
can anyone help me on this please?
© Stack Overflow or respective owner