The EXCEPTION Section

The EXCEPTION section is an optional part in any PL/SQL block. If this section is omitted and errors are encountered, the block will be terminated. Some errors that are encountered may not justify the immediate termination of a block, so the EXCEPTION section can be used to handle specified errors or user-defined exceptions in an orderly manner. Exceptions can be user defined although many exceptions are predefined by Oracle.

An exception is an error that is raised during processing when running a PL/SQL program.

Raising Exceptions

Exceptions are raised in a block by using the command RAISE. Exceptions can be raised explicitly ...

Get Sams Teach Yourself SQL in 21 Days, Fourth Edition 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.