最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
oracle用存储过程实现mysql的drop if exists
时间:2022-06-29 09:55:24 编辑:袖梨 来源:一聚教程网
以下oralce存储过程作用类似于mysql的 drop if exists功能。
| 代码如下 | 复制代码 |
| --判断制定表是否存在,如果存在删除该表。 create or replace procedure proc_dropifexists( p_table in varchar2 ) is v_count number(10); begin select count(*) into v_count from user_tables where table_name = upper(p_table); if v_count > 0 then execute immediate 'drop table ' || p_table ||' purge'; end if; end proc_dropifexists; | |
在调用存储过程的时候出了点小问题。在PLSQL中执行以上存储过程,网上很多文章都
用 exec proc_dropifexists('表名');
或者 execute proc_dropifexists('表名');
来执行。但本人在执行以上语句的时候总是报'ora 00900' 无效语句错误,不知为何。
最后用: call proc_dropifexists('表名'); 执行成功。
相关文章
- 原神胡桃大战史莱姆在哪免费观看-胡桃大战史莱姆观看地址分享 08-10
- Karpathy刚进Anthropic,转头又投了它 08-10
- 光与夜之恋农场料理台菜谱最佳合成方案 08-10
- yy漫画app最新下载入口-歪歪漫画首页免广告直接进 08-10
- 软银机器人已开始量产 08-10
- “太空算力没有意义”,孙正义给马斯克泼冷水 08-10