Using call statement in a dynamic statement is legal : Call « Stored Procedure Function « Oracle PL / SQL






Using call statement in a dynamic statement is legal

  
SQL>
SQL> CREATE OR REPLACE PROCEDURE CallProc1(p1 IN VARCHAR2 := NULL) AS
  2  BEGIN
  3    DBMS_OUTPUT.PUT_LINE('CallProc1 called with ' || p1);
  4  END CallProc1;
  5  /

Procedure created.

SQL>
SQL> DECLARE
  2    myResult VARCHAR2(50);
  3  BEGIN
  4    EXECUTE IMMEDIATE 'CALL CallProc1(''Hello from PL/SQL'')';
  5  END;
  6  /
CallProc1 called with Hello from PL/SQL

PL/SQL procedure successfully completed.

SQL>
SQL>

   
  








Related examples in the same category

1.CALL statement.
2.demonstrates using DBMS_SQL to execute CALL statement.
3.illegal procedure call
4.EXECUTE IMMEDIATE dynamic statement and return value
5.This script demonstrates the use of the CALL statement.