写个匿名块就行了,例子:
SQL> create table test(a number);
Table created
SQL>
SQL> declare
2 v_count number;
3 begin
4 select count(1) into v_count from user_tables t where t.TABLE_NAME='TEST';
5 if v_count>0 then
6 execute immediate'drop table TEST';
7 end if;
8 execute immediate 'create table test(b number)';
9 end;
10 /
PL/SQL procedure successfully completed
SQL> select * from test;
B
----------