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 tables Session issue

668570Apr 27 2009 — edited Apr 27 2009
Hi ,

Am a developer with more Sql Server experience than Oracle 9i.
I Am working on Web application developed in C#,for which I need to use Global temporary tables in pl/sql procedure.
(
I use the temp tables to store the unique ids of the transaction table I am trying to fetch data from.
I need to use a temp table as there are various conditions to be filtered.
)

The only issue here is that Oracle says GTT can be either session specific or transaction specific.
I want want the data in the temp table to exist only for the scope of the PL/SQL procedure and not persist beyond that.

What I found was that each time I refreshed the page ( for every refresh the PL/SQL procedure is invoked once ) the no of records being displayed kept increasing as the Oracle session does not get terminated due to connection pooling
and it keeps adding records to the temp table.
.
Under such circumstances what can be done to make the data persist only for the current PL/SQL scope?.

Currently am using a rough hack,inserting a sequence value ( which is unique everytime the PL/SQL procedure is invoked ) into the temporary table.
It does do the job, but am not very happy with this.

Incidentally this is effortlessly done in sql server using inline tables.

Can somebody suggest a better approach.

ps:
PL/SQL tables wont work for me as I need to delete data from the temp table using sql syntax
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 25 2009
Added on Apr 27 2009
4 comments
1,981 views