Introduction

Bind variables can be of type IN, OUT, or IN OUT just like any other parameters.

By default, all parameters are of type IN.

The following code shows how to use an OUT Parameter

Demo

SQL>
SQL> declare-- from ww  w  . j  a v  a  2  s. c o m
  2      a NUMBER;
  3      b NUMBER:=1;
  4
  5      c NUMBER:=2;
  6      v_plsql_tx VARCHAR2(2000);
  7  begin
  8      v_plsql_tx :='begin :1:=:2+:3; end;';
  9      execute immediate v_plsql_tx
 10      using out a, b, c;
 11      DBMS_OUTPUT.put_line('a='||a);
 12  end;
 13  /
a=3

PL/SQL procedure successfully completed.
SQL>
SQL>

Related Topic