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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.