Updated on 2024-12-09 GMT+08:00

Temporary Tables

GaussDB(DWS) does not support GLOBAL TEMPORARY TABLE, It migrates GLOBAL TEMPORARY TABLE to LOCAL TEMPORARY TABLE.

ON COMMIT DELETE ROWS is also not supported and will be migrated to ON COMMIT PRESERVE ROWS.

The following is an example of the syntax of a temporary table before and after migration.

Pre-migration

Figure 1 GLOBAL TEMPORARY TABLE and ON COMMIT DELETE ROWS

1
2
3
4
5
6
7
8
9
CREATE
       GLOBAL TEMPORARY TABLE
                   schema1.temp_tbl1 
                  (
                        col1 VARCHAR2 (400),
                        col2 DATE NOT NULL
                   )
                      ON COMMIT DELETE ROWS
;

Post-migration

Figure 2 LOCAL TEMPORARY TABLE and ON COMMIT PRESERVE ROWS

1
2
3
4
5
6
7
8
9
CREATE
       LOCAL TEMPORARY TABLE
                   schema1_temp_tbl1 
                  (
                        col1 VARCHAR2 (400),
                        col2 DATE NOT NULL
                   )
                      ON COMMIT PRESERVE ROWS
;