PL/SQL中動態掉用儲存過程

zhouwf0726發表於2019-05-06
PL/SQL中動態掉用儲存過程:

SQL> set serverout on

SQL> create or replace procedure p_test(a in varchar2,b in varchar2,c out varchar2)
2 is
3 begin
4 c := a||b;
5 end p_test;
6 /

Procedure created

SQL> declare
2 v_sql varchar2(1000);
3 c varchar2(1000);
4 begin
5 v_sql:='begin p_test(:v1,:v2,:v3); end;';
6 execute immediate v_sql using in '1',in '2',out c;
7 dbms_output.put_line(c);
8 end;
9 /

12

PL/SQL procedure successfully completed

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/756652/viewspace-242321/,如需轉載,請註明出處,否則將追究法律責任。

相關文章