Create a temporary table whose rows will be deleted at the end of a session by specifying ON COMMIT PRESERVE ROWS : Temporary Table « Table « Oracle PL/SQL Tutorial






SQL>
SQL> CREATE GLOBAL TEMPORARY TABLE mytemp (
  2    id INTEGER,
  3    status VARCHAR2(10),
  4    last_modified DATE DEFAULT SYSDATE
  5  )
  6  ON COMMIT PRESERVE ROWS;

Table created.

SQL>
SQL> INSERT INTO mytemp (
  2  id, status
  3  ) VALUES (
  4   1, 'New'
  5  );

1 row created.

SQL>
SQL> --DISCONNECT
SQL> --CONNECT userName/password
SQL>
SQL> --SELECT * FROM order_status_temp;
SQL>








6.20.Temporary Table
6.20.1.create global temporary table
6.20.2.Global temporary table and connection
6.20.3.create global temporary table transaction_tab on commit delete rows
6.20.4.Create a temporary table whose rows will be deleted at the end of a session by specifying ON COMMIT PRESERVE ROWS
6.20.5.Using Varrays in Temporary Tables