Alternatives for temporary tables in Oracle

前端 未结 2 1556
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-06 16:59
  1. Create a temporary table inside a stored procedure, say \'#Temp\'.
  2. Insert values into \'Temp\' table using a select statement, eg. Insert Into #Temp Select * from
2条回答
  •  囚心锁ツ
    2021-02-06 17:52

    Create a global temporary table.

    CREATE GLOBAL TEMPORARY TABLE 
    ON COMMIT PRESERVE ROWS   # If needed.  Depends on your needs.
    AS SELECT ;
    

    You can then select from the table as needed for the duration of your procedure.

    http://www.oracle-base.com/articles/8i/TemporaryTables.php

    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:15826034070548

提交回复
热议问题