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

时间:2022-03-21 02:06:05

procedure:

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

for above procedure executing purpose i wrote follow pl/sql code

对于上述程序执行目的,我写了以下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;

My question is there is any method to execute my Procedure.Let me know please

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

1 个解决方案

#1


0  

Procedure:

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

This will work try this......

这将尝试这个......

#1


0  

Procedure:

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

This will work try this......

这将尝试这个......