Chapter 8 – Temporary Tables

“I cannot imagine any condition which would cause this ship to founder. Modern shipbuilding has gone beyond that.”

- E. I. Smith, Captain of the Titanic

There are two types of Temporary Tables

Derived Table

•Exists only within a query

•Materialized by a SELECT Statement inside a query

•Space comes from the User’s space Spool space

•Deleted when the query ends

Global Temporary Table

•Table definition is created by a User and the table definition is permanent

•Materialized with an INSERT/SELECT

•When User logs off the session the data is deleted, but the table definition stays

•Many Users can populate the same Global table, but each has their own copy

•Are created in the public schema, with the data contents ...

Get Tera-Tom Genius Series - DB2 SQL now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.