declare num number;
begin
execute immediate 'select count(1) from user_tables where table_name = upper('||'''tableName'''||')' into num;
DBMS_OUTPUT.PUT_LINE(num);
if num > 0 then
execute immediate 'drop table tableName' ;
end if;
execute immediate 'create table tableName
(
templateid VARCHAR2(20) not null,
templatename VARCHAR2(500),
fundcode VARCHAR2(10),
fundname VARCHAR2(100),
templatetype VARCHAR2(10),
creator VARCHAR2(10),
createtime VARCHAR2(20),
updatetime VARCHAR2(30) default to_char(sysdate,'||'''yyyy-mm-dd hh24:Mi:ss'''||'),
checktype VARCHAR2(20) default 0,
isstandard VARCHAR2(10)
)';
end;
其中tableName替换成自己的表名