执行存储过程的执行方式有多少

时间:2013-11-28 09:05:30

标签: sql oracle stored-procedures plsql

过程:

CREATE OR REPLACE PROCEDURE DOUBLEN (N IN OUT number) IS
BEGIN
    N := N * 2;
END;  

对于上述程序执行目的,我写了以下pl / sql代码

DECLARE
    R INT;
BEGIN
    R := 7;
    DBMS_OUTPUT.PUT_LINE('BEFORE CALL R IS: ' || R);
    DOUBLEN(R);
    DBMS_OUTPUT.PUT_LINE('AFTER CALL R IS: ' || R);
END;

我的问题是有任何方法可以执行我的程序。请告诉我

1 个答案:

答案 0 :(得分:0)

程序:

create or replace procedure proc_in_out
 (n in out number)
 as 
 begin
 dbms_output.put_line('value of n before manipulation'||' '||n);
 n:=n*2;
 dbms_output.put_line('value of n after manipulation'||' '||n);
end proc_in_out;

  set serveroutput on;
     declare 
      n number;
      begin
      n:=2;
      proc_in_out(n);
    end;

    anonymous block completed
    value of n before manipulation 2
    value of n after manipulation 4

这样可以试试这个......