A programming notion that is truly derived from Greek is pragma, which means “deed” or, by implication, an “action.” In various programming languages, a pragma is generally a line of source code prescribing an action you want the compiler to take. It’s like an option that you give the compiler; it can result in different runtime behavior for the program, but it doesn’t get translated directly into bytecode.
PL/SQL has a PRAGMA keyword with the following syntax:
The PL/SQL compiler will accept such directives anywhere in the declaration section, but most of them have certain additional requirements regarding placement.
PL/SQL offers several pragmas:
Tells the PL/SQL runtime engine to commit or roll back any changes made to the database inside the current block without affecting the main or outer transaction. See Chapter 14 for more information.
Tells the compiler to associate a particular error number with an identifier you have declared as an exception in your program. Must follow the declaration of the exception. See Chapter 6 for more information.
Tells the compiler the purity level (freedom from side effects) of a packaged program. See Chapter 17 for more information.
Tells the PL/SQL runtime engine that package-level data should not persist between references to that data. See Chapter 18 for more information.
The following block demonstrates the use of the EXCEPTION_INIT ...