Re: create temp table

From: Sergei Kuchin <skuchin_at_sprynet.com>
Date: Mon, 24 Jan 2000 15:50:13 -0600
Message-ID: <388CC915.283D_at_sprynet.com>


[Quoted] [Quoted] I believe that the original question was if Oracle has temp tables in the exact sense as in MS SQL. The answer is NO. The problem with creating a "permament" temp table is that its name is global as opposed to #<table_name>'s, which is local to the current session. Also, #<temp_tables>'s go away when the session ends. So, the quick and dirty solution would be to create a "permanent" work table with the same set of columns as in the #<temp_table>, plus a unique ID field to identify groups of records for multiple sessions. If only one copy of the #temp_table is needed, then Bob's solution works just fine.

Sergei Kuchin

Robert Sullivan wrote:
>
> "Wafflart Sébastien" wrote:
> > Microsoft SQL server has function wish allow to create temp table:
> >
> > select * from table into #table_temp
> >
> > Does exist a same function in Oracle database ?
>
> Sure, you'd just do this in SQL*Plus:
>
> create table <temp_table_name> as (
> select * from <source_table_name>
> );
>
> Replacing, obviously, the angle brackets and their contents
> with the temporary table name and the source table name,
> respectively.
>
> cheers,
> bob :)
> Oracle Applications Administrator
Received on Mon Jan 24 2000 - 22:50:13 CET

Original text of this message