Oracle® Database PL/SQL Language Reference 11g Release 2 (11.2) Part Number E10472-05 |
|
|
View PDF |
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, subprogram, or package. A procedure invocation, or procedure call, is a statement.
A procedure declaration is also called a procedure specification, or procedure spec.
Note:
This topic applies to procedures that you declare and define inside a PL/SQL block, subprogram, or package. These procedures differ from standalone stored procedures that you create with the "CREATE PROCEDURE Statement", as explained in "Overview of PL/SQL Subprograms".
A procedure declared and defined in a package is affected by the AUTHID
clause of the package. For more information, see "CREATE PACKAGE Statement".
Topics:
Syntax
procedure_declaration ::=
procedure_heading ::=
See parameter_declaration ::=.
procedure_definition ::=
See:
Semantics
procedure_declaration
Declares a procedure, but does not define it. The definition must appear later in the same block, subprogram, or package as the declaration.
procedure_heading
procedure_name
The name that you give to the procedure that you are declaring or defining.
procedure_definition
Either defines a procedure that was declared earlier or both declares and defines a procedure.
declare_section
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.
body
The required executable part of the procedure and, optionally, the exception-handling part of the procedure.
Examples
Related Topics
In this chapter:
In other chapters: