DECLARE
e_products_invalid EXCEPTION;
PRAGMA EXCEPTION_INIT (e_products_invalid, -2292);
v_message VARCHAR2(50);
BEGIN
. . .
EXCEPTION
WHEN e_products_invalid THEN
v_message := 'Product code specified is not valid.';
. . .
END;
========
PRAGMA是单词pragmatics的简写。
============
A pragma is a compiler directive, which can be thought of as a parenthetical remark to the compiler.
============
Pragmas (also called pseudoinstructions) are processed at compile time, not at run time.
============
For example, In PL/SQL,
the pragma EXCEPTION_INIT tells the compiler to associate an exception name with an Oracle error number. ============
That allows you to refer to any internal exception by name and to write a specific handler for it.: