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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Temporary Tables - 2 or 3

Re: Temporary Tables - 2 or 3

From: GovindanK <gkatteri_at_fastmail.fm>
Date: Fri, 26 Aug 2005 11:12:29 -0700
Message-Id: <1125079949.12677.241566919@webmail.messagingengine.com>


SQL>create global temporary table my_log_table   2 (ind number(02)
  3 ,log_date date
  4 )
  5 on commit preserve rows
  6 /

Table created.

SQL>DECLARE
  2 l_date date;
  3 begin
  4 EXECUTE IMMEDIATE 'insert into my_log_table values(03,sysdate)' ;   5 commit;
  6 SELECT log_date into l_date

  7               FROM my_log_table
  8              WHERE ind=03 and rownum < 2
  9            ;
 10     dbms_output.put_line(l_date);

 11 null;
 12 end;
 13 /
26-AUG-05 PL/SQL procedure successfully completed.

SQL>
You would require this if you need to do large inserts (we did insert /*+ append */) followed by select for open cursor to return resultset to the front end appl.

HTH
GovindanK

On Fri, 26 Aug 2005 11:52:23 -0400, "Aggarwal, Meenakshi" <Meenakshi.Aggarwal_at_fishersci.com> said:
> Does anybody know any reason of not using temporary tables in
> Oracle 9i.
>
> Thanks
> --
> http://www.freelists.org/webpage/oracle-l

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Aug 26 2005 - 13:14:28 CDT

Original text of this message

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