PL/SQL Basic Syntax

All PL/SQL has the same basic format: a DECLARE section where cursors and variables are defined, a BEGIN, and an END where the SQL syntax and PL/SQL code is put. This is known as a PL/SQL block. Exception or exception handling is errors or flags in PL/SQL. Exceptions are a way of gracefully handling certain conditions within the PL/SQL block, such as “no records returned from the SQL query” or “last record returned from the SQL query”. Other exceptions can be syntax errors in the PL/SQL code itself.

NOTE

Cursors are Oracle's way of processing SQL statements and storing the rows returned from a query, allowing for the PL/SQL block to easily handle individual rows from a query that returns multiple rows. A cursor is a work area ...

Get Oracle9i™ Development by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.