救命:表或视图不存在(单独执行时没有问题,一放入过程就出现问题了)
SQL> select count(*) from dba_users;
COUNT(*)
----------
31
没有问题
下面:
create or replace procedure ckuName(userName varchar2)
as
num integer;
userName_local varchar2(20);
begin
userName_local := upper(userName);
select count(*) into num from DBA_USERS ;
if num>0 then
execute immediate 'drop user '||userName;
dbms_output.put_line('用户删除成功');
else
dbms_output.put_line('用户不存在');
end if;
end;
/
出错:
Warning: Procedure created with compilation errors
SQL> show error;
Errors for PROCEDURE SYSTEM.CKUNAME:
LINE/COL ERROR
-------- ---------------------------------
7/38 PL/SQL: ORA-00942: 表或视图不存在7/8 PL/SQL: SQL Statement ignored