Understanding bind variable types : Binded variable « PL SQL Statements « Oracle PL/SQL Tutorial






Bind variables can be of type IN, OUT, or IN OUT.

By default, all parameters are of type IN.

Using an OUT Parameter

SQL> declare
  2     a NUMBER;
  3     b NUMBER:=1;
  4     c NUMBER:=2;
  5     v_plsql_tx VARCHAR2(2000);
  6  begin
  7      v_plsql_tx := 'begin ' || ':1:=:2 -:3; ' || 'end;';
  8      execute immediate v_plsql_tx using out a, b, c;
  9      DBMS_OUTPUT.put_line('a='||a);
 10  end;
 11  /
a=-1

PL/SQL procedure successfully completed.

SQL>








22.14.Binded variable
22.14.1.Understanding bind variable types
22.14.2.Passing several bind variables
22.14.3.Using Multiple Bind Variables
22.14.4.Using a NULL bind variable
22.14.5.Reusing Bind Variables in Dynamic SQL
22.14.6.Use quotation with a bind variable