Oracle创建临时表的语法如下:
CREATE GLOBAL TEMPORARY TABLE table
"(" column datatype [DEFAULT expr] [{ NULL | NOT NULL}]
[, column datatype [DEFAULT expr] [ {NULL | NOT NULL} ]... ")"
ON COMMIT {DELETE | PRESERVE } ROWS ;
在Oracle中,可以创建以下两种临时表:
1) 会话特有的临时表
CREATE GLOBAL TEMPORARY ( )
ON COMMIT PRESERVE ROWS;
2) 事务特有的临时表
CREATE GLOBAL TEMPORARY ( )
ON COMMIT DELETE ROWS;
CREATE GLOBAL TEMPORARY TABLE MyTempTable