Using temporary tables
Temporary tables are used by applications that store results temporarily in a table.
There are two types of temporary tables, the declared global temporary table and the created global temporary table. The terms can appear confusing, so we'll explain, Declared Global temporary table
Also known as USER-DEFINED temporary table, a declared global temporary table is defined, or declared, for the current session and does not appear in the system catalog. This session has its own version, and this table is not visible to other sessions, hence the USER-DEFINED nickname. When the session ends, the table is dropped.
Getting ready
A user temporary table space must be present.
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...