Demmonstrate the creation and execution of a simple PL/SQL procedure. : EXEC « Function Procedure Packages « Oracle PL/SQL Tutorial






SQL>
SQL> create or replace procedure add_up
  2   (p1  in  number DEFAULT 0,
  3    p2  in  number DEFAULT 0,
  4    p3  out number)
  5  as
  6  begin
  7    p3 := p1 + p2;
  8  end;
  9  /

Procedure created.

SQL>
SQL> show errors
No errors.
SQL>
SQL> -- execute from SQL*Plus:
SQL>
SQL> var x number
SQL> exec add_up(10,10,:x)

PL/SQL procedure successfully completed.

SQL> print x

         X
----------
        20

SQL>
SQL>








27.23.EXEC
27.23.1.Demmonstrate the creation and execution of a simple PL/SQL procedure.
27.23.2.Use EXEC to call a procedure in a package