Oracle PL/SQL - Database procedures and functions

Introduction

To create a procedure:

create [or replace] 
procedure procedure name (parameters) 
 is 
  ... 
begin 
  ... 
 end; 

To create a function:

create [or replace]  
 function function name (parameters) 
 return ... 
 is 
  ... 
begin 
  ... 
end; 

The CREATE OR REPLACE procedure/function command tells Oracle to create a stored procedure.

If the stored procedure with the specified name exists, you will overwrite it.

By default, procedures and functions are created in the same Oracle schema as that of the user connected to the database.

After functions are created, you can use them as you use built-in PL/SQL or SQL functions or procedures:

begin 
     p_print('Hi','anybody','...'); -- that is enough! 
end; 

Related Topic