◆◆◆请一类似SQLServer 语句IF exists 的Oracle写法
IF exists(SELECT NAME FROM sysobjects WHERE NAME = 'LoginCheck' AND type = 'p')DROP PROCEDURE LoginCheck
declare i int;begin select count(*) into i from user_objects where object_name=upper('LoginCheck') and object_Type=upper('procedure'); if i>0 then execute immediate 'DROP PROCEDURE LoginCheck'; end if;end;
[解决办法]
begin
for i in (select null from user_objects where object_name=upper('LoginCheck') and object_Type=upper('procedure')) loop
execute immediate 'DROP PROCEDURE LoginCheck';
end loop;
end;