Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2004
    Posts
    19

    Unanswered: temporay tables in oracle as sql server

    Hello, I need to know if oracle 9i or 10G has temporary tables in a way SQL Server, it is:
    An instruction :

    select * into #table_temporal from table….

    Where #table_temporal only exists for the session where
    this query is executed. Here, I don´t need to do before a sentence ‘create temporary table’.
    Anybody know?
    Thanks a lot¡

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Perhaps a global temporary table is what you're looking for ... there's no need to first create it and then insert data - you can do it in one sentence, such as

    CREATE GLOBAL TEMPORARY TABLE gtt_emp AS
    SELECT * FROM emp WHERE deptno = 10;

    Its definition is visible to all sessions, but the data in a temporary table is visible only to the session that inserts the data into the table. Read more about GTT's here.

  3. #3
    Join Date
    Sep 2004
    Posts
    19

    temporary table in oracle

    Thanks, but the temporary table doesn´t drop where the session ends, only the data are deleted.
    I need the table disapears with the session ends
    Thanks for you help.

  4. #4
    Join Date
    Mar 2002
    Location
    Reading, UK
    Posts
    1,137
    Why do you need to drop the table? Will you be creating hundreds of tables with different structures?

    The other point is why are you using a temp table you may find that with Oracle you dont need temp tables.

    Alan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •