如题所述
ä¸é¢çä¾å代ç ï¼ ä»
ä»
ç¨äºæ¼ç¤º in out ï¼ æ²¡æä»»ä½æ°æ®åºæ£ç´¢çå¤çã
注ï¼Oracle ç IN OUT åå¨åéååé¢ãSQL> CREATE OR REPLACE PROCEDURE HelloWorld2 ( 2 p_user_name IN VARCHAR2, 3 p_out_val OUT VARCHAR2, 4 p_inout_val IN OUT VARCHAR2 5 ) AS 6 BEGIN 7 dbms_output.put_line('Hello ' || p_user_name || p_inout_val || '!'); 8 p_out_val := 'A'; 9 p_inout_val := 'B'; 10 END HelloWorld2; 11 /Procedure created.SQL> DECLARE 2 p_outval VARCHAR2(10); 3 p_inoutval VARCHAR2(10) := '~Hi~'; 4 BEGIN 5 HelloWorld2('Edward', p_outval, p_inoutval); 6 7 dbms_output.put_line('p_outval=' || p_outval); 8 dbms_output.put_line('p_inoutval=' || p_inoutval); 9 END; 10 /Hello Edward~Hi~!p_outval=Ap_inoutval=BPL/SQL procedure successfully completed.SQL>
注ï¼Oracle ç IN OUT åå¨åéååé¢ãSQL> CREATE OR REPLACE PROCEDURE HelloWorld2 ( 2 p_user_name IN VARCHAR2, 3 p_out_val OUT VARCHAR2, 4 p_inout_val IN OUT VARCHAR2 5 ) AS 6 BEGIN 7 dbms_output.put_line('Hello ' || p_user_name || p_inout_val || '!'); 8 p_out_val := 'A'; 9 p_inout_val := 'B'; 10 END HelloWorld2; 11 /Procedure created.SQL> DECLARE 2 p_outval VARCHAR2(10); 3 p_inoutval VARCHAR2(10) := '~Hi~'; 4 BEGIN 5 HelloWorld2('Edward', p_outval, p_inoutval); 6 7 dbms_output.put_line('p_outval=' || p_outval); 8 dbms_output.put_line('p_inoutval=' || p_inoutval); 9 END; 10 /Hello Edward~Hi~!p_outval=Ap_inoutval=BPL/SQL procedure successfully completed.SQL>
温馨提示:答案为网友推荐,仅供参考