Chapter 3. Declared Global Temporary Tables

A declared global temporary table (DGTT) is created using the DECLARE GLOBAL TEMPORARY TABLE statement and is used to hold temporary data on behalf of a single application. The DECLARE statement is very similar to the CREATE statement used to create persistent tables.

A DGTT is dropped implicitly when its owning application disconnects from the database. DGTTs are often used by application developers when they need a temporary location to store data that will be used for further processing. Without these types of tables, the database engine would go through overhead activities (e.g., logging, locking, etc.) to persist and manage a table that wasn't needed in the long run. The application developer ...

Get DB2® Version 8: The Official Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.