--会话级临时表是指临时表的数据只在会话生命周期中存在,当用户退出会话的时候,Oracle自动清除临时表中的数据 create global temporary table tmp_Preserve_student( stu_id varchar2(4), stu_name varchar2(100), sex varchar2(1) ) On Commit Preserve Rows; --测试数据 insert into tmp_Preserve_student (stu_id, stu_name, sex)values ('0001', '大王', '2'); insert into tmp_Preserve_student (stu_id, stu_name, sex)values ('0002', '赵一', '1'); insert into tmp_Preserve_student (stu_id, stu_name, sex)values ('0003', '孙二', '1'); select * from tmp_Preserve_student; commit; select * from tmp_Preserve_student; --事务级临时表只在事务生命周期中存在 create global temporary table tmp_Delete_student( stu_id varchar2(4), stu_name varchar2(100), sex varchar2(1) ) On Commit Delete Rows; --测试数据 insert into tmp_Delete_student (stu_id, stu_name, sex)values ('0001', '大王', '2'); insert into tmp_Delete_student (stu_id, stu_name, sex)values ('0002', '赵一', '1'); insert into tmp_Delete_student (stu_id, stu_name, sex)values ('0003', '孙二', '1'); select * from tmp_Delete_student; commit; select * from tmp_Delete_student;
标签:tmp,name,临时,sex,stu,student,Oracle,id From: https://www.cnblogs.com/wangrui1587165/p/17083118.html