select count(1) into i_count from user_tables where table_name='SESSION_TMP_EMP'
if i_count<1 then
execute immediate 'create global temporary table SESSION_TMP_EMP
(
empid integer,
empname varchar2(22),
stype char(1)
) on commit preserve rows' ;
else
execute immediate 'truncate table SESSION_TMP_EMP ';
end if ;
execute immediate 'insert into SESSION_TMP_EMP
select empid,empname,stype
from rpt_emp where in_data=20130131';
session 1执行完之后,在session 2 中 我想drop table SESSION_TMP_EMP
执行之后,会发现drop不了
ORA-14452: attempt to create, alter or drop an index on temporary table already in use