这两段代码的区别

wudaoyou 2008-10-22 05:16:21
我有这么两端代码
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里面第一段就运行不了了?


...全文
52 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
chensi05 2008-10-22
  • 打赏
  • 举报
回复
如果执行不了贴错误提示
xliming100 2008-10-22
  • 打赏
  • 举报
回复
我复制你的代码在 sql plus运行没出错
szflower 2008-10-22
  • 打赏
  • 举报
回复
在每个块加个顶格/看看.

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧