“ ORA-24344:编译错误成功”

时间:2019-01-09 08:12:51

标签: plsql

我刚开始使用pl / sql并发现此错误。有人能说出问题所在吗?

create or replace procedure findmin(x in number, y in number, z out 
number)
is
begin
if x<y then z:= x;
else z:=y;
end if;
end;


set serveroutput on;
declare
a number;
b number;
c number;
begin
a:=23;
b:=46;
findmin(a, b, c);
dbms_output.put_line('minimum of the 2 numbers is' || c);
end;

1 个答案:

答案 0 :(得分:0)

存在NO错误。可能是您执行不正确。

SQL> CREATE OR REPLACE PROCEDURE findmin(
  2                                      x IN NUMBER,
  3                                      y IN NUMBER,
  4                                      z OUT NUMBER)
  5  IS
  6  BEGIN
  7    
  8    IF x<y THEN
  9      z:= x;
 10    
 11    ELSE
 12      z:=y;
 13    
 14    END IF;
 15  
 16  END;
 17  
 18  /

Procedure created.

SQL> set serveroutput on;
SQL> DECLARE
  2    a NUMBER;
  3    b NUMBER;
  4    c NUMBER;
  5  BEGIN
  6    a:=23;
  7    b:=46;
  8    findmin(a, b, c);
  9    dbms_output.put_line('minimum of the 2 numbers is ' || c);
 10  
 11  END;
 12  /
minimum of the 2 numbers is 23

PL/SQL procedure successfully completed.