Procedure Declaration and Definition

A procedure is a subprogram that performs a specific action.

You must declare and define a procedure before invoking it. You can either declare and define it at the same time, or you can declare it first and then define it later in the same block or subprogram.


This topic applies to procedures that you declare and define inside a PL/SQL block or package, which are different from standalone stored procedures that you create with the CREATE PROCEDURE Statement.


procedure_declaration ::=

Description of the illustration procedure_declaration.gif

procedure_heading ::=

Description of the illustration procedure_heading.gif

(parameter_declaration ::=)

procedure_definition ::=

Description of the illustration procedure_definition.gif

(body ::=, declare_section ::=)

Keyword and Parameter Descriptions


The required executable part of the procedure and, optionally, the exception-handling part of the procedure.


The optional declarative part of the procedure. Declarations are local to the procedure, can be referenced in body, and cease to exist when the procedure completes execution.


Declares a procedure, but does not define it. The definition must appear later in the same block or subprogram as the declaration.

A procedure declaration is also called a procedure specification, or procedure spec.


Either defines a procedure that was declared earlier in the same block or subprogram, or declares and defines a procedure.


The name that you give to the procedure that you are declaring or defining.


Related Topics