2013-11-28 59 views
-2

程序:有多少種方法執行存儲過程將被執行

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; 

我的問題是有什麼方法執行我的程序。請讓我知道

+0

到底是什麼問題了嗎?它對我來說工作正常嗎? – Armunin

+0

@Armuni有任何其他方法來執行我的存儲過程。 – ram

+0

我不確定你想知道什麼?爲什麼你需要另一種執行程序的方式? – Armunin

回答

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 

這將工作試試這個......

+0

匿名塊完成執行,但沒有出現 – ram

+0

不知道如何回答問題,因爲問題中的代碼工作正常。 – Armunin