Given the following statement:
DECLARE GLOBAL TEMPORARY TABLE TEMP1 (
ID INTEGER NOT NULL,
ITEM CHAR(30),
AMOUNT DECIMAL (10,2)
ON COMMIT DELETE ROWS NOT LOGGED;
Which of the following statements are TRUE? (Choose two.)
Given the following statement:
DECLARE GLOBAL TEMPORARY TABLE TEMP1 (
ID INTEGER NOT NULL,
ITEM CHAR(30),
AMOUNT DECIMAL (10,2)
ON COMMIT DELETE ROWS NOT LOGGED;
Which of the following statements are TRUE? (Choose two.)
The Temp1 table is accessed under the schema SESSION because global temporary tables are session-specific and its name is qualified by the SESSION schema. Additionally, at the end of a transaction, data is deleted automatically as specified by the ON COMMIT DELETE ROWS clause. This means that any data stored in the table will be removed when a transaction commits.
I agree the correct answer is A & C
You have also the statement CREATE GLOBAL TEMPORARY, which is different of "DECLARE GLOBAL TEMPORARY" statement. The CREATE GLOBAL TEMPORARY TABLE statement creates a description of a temporary table at the current server. But, each session that selects from a created temporary table retrieves only rows that the same session has inserted. When the session terminates, the rows of the table associated with the session are deleted. See reference : https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.1.0/com.ibm.db2.luw.sql.ref.doc/doc/r0053719.html
The correct answer are : A. Temp1 table is accessed under schema SESSION C. At the end of a transaction, data is deleted automatically See reference : https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.1.0/com.ibm.db2.luw.sql.ref.doc/doc/r0003272.html he DECLARE GLOBAL TEMPORARY TABLE statement defines a temporary table for the current session. The declared temporary table description does not appear in the system catalog. It is not persistent and cannot be shared with other sessions. Each session that defines a declared global temporary table of the same name has its own unique description of the temporary table. When the session terminates, the rows of the table are deleted, and the description of the temporary table is dropped.