Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Global Temporary Table

Re: Global Temporary Table

From: Frank <fvanbortel_at_netscape.net>
Date: Mon, 20 Oct 2003 22:28:11 +0200
Message-ID: <bn1g2u$hjq$1@news2.tilbu1.nb.home.nl>


Howard J. Rogers wrote:

> Raj wrote:
> 
> 

>>Hello Oraclegurus,
>>
>> I would like to know if i am doing the right thing or not??
>>
>> I've created a global temporary table "tempcomp".
>>
>> "create global temporary table tempcomp (col1 number,col2
>>char,col3varchar2)" .
>>
>> I looked into these groups and it was mentioned somewhere
>>that default is "on commit delete rows"... I am assuming that the rows
>>are being deleted after commit and not stored .
>>
>> We have a web application which would be calling a stored
>>procedure which inserts into a global temporary some values we need
>>the values only for temporary time i.e., till user wants to study
>>those values .
>>
>> The web client users could be many and they all connect the
>>application with their respective id but the database connectivity is
>>using only one database userid "scott" and accessing the schema and
>>shcema procedures.
>>
>> The procedure call does inserts into the temporary global
>>table.
>>
>> The data that would be inserted could be like this 'bike'
>>'big' 'bum' etc
>>
>> question: If one web user queries the table .... "where col2
>>like 'b%'
>>
>> will he get the data which was inserted on execution of
>>procedure by the first user who caused the inserts 'bike' 'bum'etc
>>..????
>>
>> or each web user is a seperate session and the select query
>>will be unique for each user ...?????
>>
>> Please let me know if i am using the right thing by using
>>global temporary table !
>>
>> Thanks in advance.
>> Regards,
>> Raj.
> 
> 
> 
> The data that is inserted into a global temporary table is private to the
> session that put it there. If I insert 'bum', and you insert 'big', and
> fred does a select, fred sees no rows whatsoever. If I do a select, I see
> 'bum'; if you do a select, you see 'big'. No-one, under any circumstances,
> sees the entire set of rows that happen to be present at any one
> nano-second.
> 
> Regards
> HJR
> 
> 

And you might end up with seeing nothing, too, depending on your web application - only when it uses a persistent (stateful) session.
-- 
Regards, Frank van Bortel
Received on Mon Oct 20 2003 - 15:28:11 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US