Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Global Temporary Table Not Dropping

597039Jan 7 2008 — edited Jan 7 2008
I am attempting to implement global temporary tables and they don't seem to drop, only truncate. See below SQLPlus output.

SQL> create global temporary table hosts_gtt
2 on commit preserve rows
3 as select * from cdm_host_1;

Table created.

SQL> select count(*) from hosts_gtt;

COUNT(*)
----------
12979

SQL> exit

Now, I log back in...

SQL> select count(*) from hosts_gtt;

COUNT(*)
----------
0

It appears that Oracle truncates the table, but does not actually drop it. Is there a way to tell Oracle to drop the table as well? What I'm trying to do is create the temporary table for the session, run some SELECT's off of it, and then have it automatically drop at the end of the session.

Best Regards,
Tom
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 4 2008
Added on Jan 7 2008
4 comments
1,128 views