如何执行pl / sql程序

时间:2013-11-27 11:28:05

标签: plsql procedure

步骤:

create or replace 
PROCEDURE ADDITION 
(
  A IN NUMBER  
, B IN NUMBER  
, C OUT number
) AS 
BEGIN
  C := A+B;
  dbms_output.put_line(c);
END ADDITION;

执行:

begin
 addition(4,5);
end;

错误:

PLS-00306: wrong number or types of arguments in call to 'ADDITION'
ORA-06550: line 2, column 2:
PL/SQL: Statement ignored
06550. 00000 -  "line %s, column %s:\n%s"
*Cause:    Usually a PL/SQL compilation error.
*Action:

如何纠正此错误。让我知道代码中的错误

1 个答案:

答案 0 :(得分:1)

您的程序需要out参数,您还需要提供该参数:

declare
 add_result number;
begin
 addition(4,5,add_result);
end;
/
相关问题