类似这个功能
CREATE TABLE IF NOT EXISTS table_new AS( SELECT * FROM table_old WHERE 1=2)这句在mysql中可以 但在oracle中不行用在oracle 存储过程中的
CREATE TABLE IF NOT EXISTS table_new AS( SELECT * FROM table_old WHERE 1=2)这句在mysql中可以 但在oracle中不行用在oracle 存储过程中的
declare
cnt number;
begin
select count(1) into cnt from user_tables where table_name=upper('table_new');
if cnt=0 then
execute immediate 'create table table_new as( select * from table_old where 1=2)';
end if;
end;