begin
if exists(select * from user_tables where table_name = 'TMP_ST') then
execute immediate 'drop table TMP_ST';
end if;
end;
这段SQL为什么会报错?错误显示"function or pseudo-column 'EXISTs' may be used inside a SQL statement only"exists只能用在sql语句里?
解决方案 »
- 请求高人详解一下关于ORACLE EBS套件的知识
- sql中,关于数据插入的问题
- between and 的返回值是什么?
- 批量Insert语句如何快速导入Oracle中呢?
- SQL优化,能不能请各位大哥帮帮忙,帮看一下
- 如何获取树形表结构的叶子节点
- Oracle(10g)安装正常,计算机重启后就出现ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
- 急救:oracle连不上!!!
- 如何实现把保存在ORACLE数据库BLOB字段中的WORD文挡用WORD打开 200410
- 紧急提问:我的小型机死机了,怎么样关闭安全的关闭数据库,在重新启动小型机?在线...
- Oracle的严重Bug?
- 从一个表提取条件更新另一个表的所有数据
--你的写法是MSSQL的语法,Oracle不支持
declare
cnt number;
begin
select Count(*) into cnt from user_tables where table_name = 'TMP_ST' ;
if cnt>0 then
execute immediate 'drop table TMP_ST';
end if;
end;
if l_row >0 then
execute immediate 'drop table TMP_ST';
end if;
declare
cnt number;
begin
select count(*) into cnt from user_tables where table_name = 'TMP_ST';
if cnt>0 then
execute immediate 'drop table TMP_ST';
end if;
end;