DB2 SQL GLOBAL TEMPORARY TABLE

DECLARE GLOBAL TEMPORARY TABLE gives you a handy option to create a table in QTEMP lib with some handy options.

  1. As DECLARE GLOBAL TEMPORARY TABLE creates a table in QTEMP lib so
  • Other sessions cannot share it.
  • It does not appear in the system catalog.
  • When you end your session, the table rows are deleted, and the table is dropped.

2. Basic syntax of DECLARE GLOBAL TEMPORARY TABLE is almost the same as CREATE TABLE statement.

  • For example, same as…