Using out parameter : Parameter OUT « Stored Procedure Function « Oracle PL / SQL






Using out parameter

    
SQL>
SQL> CREATE OR REPLACE FUNCTION CallFunc(p1 IN VARCHAR2)
  2    RETURN VARCHAR2 AS
  3  BEGIN
  4    DBMS_OUTPUT.PUT_LINE('CallFunc called with ' || p1);
  5    RETURN p1;
  6  END CallFunc;
  7  /

Function created.

SQL>
SQL>
SQL>
SQL> DECLARE
  2    myResult VARCHAR2(50);
  3  BEGIN
  4    EXECUTE IMMEDIATE 'CALL CallFunc(''Hello from PL/SQL'') INTO :myResult'
  5    USING OUT myResult;
  6  END;
  7  /
CallFunc called with Hello from PL/SQL

PL/SQL procedure successfully completed.

SQL>
SQL>
SQL>

   
    
    
  








Related examples in the same category

1.Define 'out' parameters
2.Use out parameter to get value out
3.Parameter Modes
4.Out with NOCOPY modifier.
5.Unhandled exceptions and OUT variables
6.behavior of unhandled exceptions and OUT variables.
7.Behavior of OUT variables and raised exceptions
8.Using Output Parameters
9.This procedure takes a single OUT. Out parameter is assignable
10.Out parameter is assignable