Saturday 25 May 2013

What is pragma and what are the different types of pragma?

Pragma is a compiler directive, which is used to provide an instruction to the compiler.

Four types of Pragma’s:
AUTONOMOUS_TRANSACTION
EXCEPTION_INIT
RESTRICT_REFERENCES
SERIALLY_REUSABLE
PRAGMA INLINE
Autonomous_Transactions: Tells the compiler that the function, procedure, top-level anonymous P/L SQL block, object method, or database trigger executes in its own transaction space.

Exception_Init: Tells the compiler to associate the specified error number with an identifier that has been declared an Exception in your current program or an accessible package.

Restrict_References: Tells the compiler the purity level of packaged program. The purity level is the degree to which a program does not read/write database tables and/or packaged variables.

Serially_Reusable: Tells the runtime engine that package data should not persist between references.  This is used to reduce per-user memory requirements when the package data is only needed for duration of call and not the duration of session.


PRAGMA INLINE: This directive specifies that a subprogram call either is or is not to be inlined. Inlining replaces a subprogram call with a copy of the called subprogram.
 

No comments:

Post a Comment