Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Load data in a Global Temporary Table

I have two different Oracle sessions ("session A" and "session B") on the same Oracle user.

A Global Temporary Table is populated, in "session A", with about 320,000 records.

How can I quickly insert the same 320,000 records in the global temporary table of the "session B"?

Thank you in advance for your kind suggestions!

EDIT: I have forgotten to specify that I am allowed to create ONLY GLOBAL TEMPORARY TABLES.

EDIT: I have forgotten to specify that I am not allowed to create database links

like image 260
UltraCommit Avatar asked Dec 19 '25 05:12

UltraCommit


2 Answers

The data within a temporary table is only ever visible to the current session, so I don't think there's a way to do what you want to do without another approach.

like image 125
cagcowboy Avatar answered Dec 20 '25 19:12

cagcowboy


DBMS_PIPE is the 'classic' mechanism for pushing information from one session to another. Session A would have to push data into the pipe and session B would have to pull it.

But generally the idea of databases is that sessions are independent and any commonality is in the preserved data. Going against this suggests you are using the wrong tool.

like image 21
Gary Myers Avatar answered Dec 20 '25 18:12

Gary Myers