How to create a "declared temporary table" in DB2 EMPLOYEE with columns - ID, Name, Designation and department. Explain the purpose of "Declared temporary table"?

DB2DatabaseBig Data Analytics

The declared temporary tables are also non-permanent tables but unlike created temporary tables they can be defined in the application program. The existence of a declared temporary table is limited to program execution. Since the declared temporary tables are created and deleted at the runtime, their entries are not stored into DB2 system table SYSIBM.SYSTABLES.

The declared temporary table can be defined in the program using DECLARE GLOBAL TEMPORARY TABLE statement. The advantage of a declared temporary table over a created temporary table is that we can add constraints and indexes in these tables.

Published on 12-Sep-2020 18:21:58