这两段代码的区别
我有这么两端代码
DECLARE
tbl_exist PLS_INTEGER;
begin
select count(*)
into tbl_exist
from USER_TABLES
where table_name = 'SUPER_OU_TABLE';
if (tbl_exist = 1)
then
execute immediate ' drop table SUPER_OU_TABLE';
end if;
select count(*)
into tbl_exist
from USER_TABLES
where table_name = 'ORGUNIT_MASTER_NAKISA';
if (tbl_exist = 1)
then
execute immediate ' drop table ORGUNIT_MASTER_NAKISA';
end if;
select count(*)
into tbl_exist
from USER_TABLES
where table_name = 'POSITION_HIERARCHY';
if (tbl_exist = 1)
then
execute immediate ' drop table POSITION_HIERARCHY';
end if;
select count(*)
into tbl_exist
from USER_TABLES
where table_name = 'NAKISA_OU_MASTER';
if (tbl_exist = 1)
then
execute immediate ' drop table NAKISA_OU_MASTER';
end if;
select count(*)
into tbl_exist
from USER_TABLES
where table_name = 'LOB_BA_NAMES';
if (tbl_exist = 1)
then
execute immediate ' drop table LOB_BA_NAMES';
end if;
end;
和
DROP TABLE SUPER_OU_TABLE;
DROP TABLE ORGUNIT_MASTER_NAKISA;
DROP TABLE POSITION_HIERARCHY;
DROP TABLE NAKISA_OU_MASTER;
DROP TABLE LOB_BA_NAMES;
COMMIT;
为什么,两端代码在Toad 里面都好好的,但是到了sql plus里面第一段就运行不了了?