存储过程执行无效

JS JS 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

需求很简单,我想把system用户下与test用户共有的表删除,但是存储过程执行后并没有删除,也没报错,不知道是什么问题,请大神看看
create or replace procedure dr_table is
cursor c1 is
select 'drop table '||table_name||' cascade constraints' v_name from all_tables a where owner='SYSTEM' and
exists(select table_name from all_tables b where owner='TEST' and a.TABLE_NAME=b.TABLE_NAME);
sqlstr varchar2(1000);
begin
for i in c1 loop
sqlstr:=i.v_name;
--dbms_output.put_line(sqlstr);
execute immediate sqlstr;
end loop;
end;
...全文
评论 6
收藏 已收藏
分享
返回顶部
JS
Oracle 17,133 成员 55,258 内容