forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Lu, Huayi <luhuayi@huawei.com> Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
4.5 KiB
4.5 KiB
Basic Structure
Structure
A PL/SQL block can contain a sub-block which can be placed in any section. The following describes the architecture of a PL/SQL block:
- DECLARE: declares variables, types, cursors, and regional stored procedures and functions used in the PL/SQL block.
DECLARE
- EXECUTION: specifies procedure and SQL statements. It is the main part of a program. Mandatory
BEGIN
- EXCEPTION: processes errors. Optional
EXCEPTION
- END
END; /
Type
PL/SQL blocks are classified into the following types:
- Anonymous block: a dynamic block that can be executed only for once. For details about the syntax, see Figure 1.
- Subprogram: a stored procedure, function, operator, or packages stored in a database. A subprogram created in a database can be called by other programs.
Parent topic: Syntax