Created global temporary table
New in DB2 V9.7, the Created global temporary table is also known as GLOBAL temporary table. This type of table appears in the system catalog and is created once. Created temporary tables are used by applications that stores results temporarily in a table. The difference is that a created temporary table can be shared by applications, which is why it's called a GLOBAL temporary table. Each session does not have to create this table, and only the records created by the session are visible throughout the session. Once the session is done, the records are deleted.
How to do it...
Create a user temporary table space, if it does not exist:
[db2instp@nodedb21 posp]$ db2 "CREATE USER TEMPORARY TABLESPACE > POSP_TEMP8K PAGESIZE 8K > MANAGED BY DATABASE USING ( > FILE '/data/db2/db2instp/NODE0000/posp/posp_temp8k.dbf' 100 M ) > AUTORESIZE YES MAXSIZE 500 M" DB20000I The SQL command completed successfully
Create the temporary table:
CREATE GLOBAL TEMPORARY...