Procedure without parameters : exec « Stored Procedure Function « Oracle PL / SQL






Procedure without parameters

 
SQL>
SQL> CREATE or replace PROCEDURE my_first_proc IS
  2          greetings VARCHAR2(20);
  3  BEGIN
  4          greetings := 'Hello World';
  5          dbms_output.put_line(greetings);
  6  END my_first_proc;
  7  /

Procedure created.

SQL>
SQL>
SQL> set serveroutput on
SQL> EXECUTE my_first_proc;
Hello World

PL/SQL procedure successfully completed.

SQL>
SQL> BEGIN
  2          my_first_proc;
  3  END;
  4  /
Hello World

PL/SQL procedure successfully completed.

SQL>
SQL>

 








Related examples in the same category

1.Exec: execute a procedure
2.Use EXEC to execute a Stored Procedure