Oracle – PLSQL – compiler directives summary.

Posted by Jiltin     16 March, 2009    2,668 views   

A compiler directive, data embedded in source code by programmers to tell compilers some intention about compilation. A compiler directive often tells the compiler how to compile; other source code tells the compiler what to compile. We have 4 PL/SQL compiler directives

1)AUTONOMOUS_TRANSACTION.
2)RESTRICT_REFERENCES
3)EXCEPTION_INIT.
4)SERIALLY_REUSABLE.

AUTONOMOUS_TRANSACTION:
A subprogram marked with this pragma can do SQL operations and commit or roll back those operations, without committing or rolling back the data in the main transaction.

RESTRICT_REFERENCES:
To be callable From SQL statements, a stored function must obey certain purity rules, which control side-effects. If any SQL statement inside the function body violates a rule, you get an error at run time. You can declare the pragma RESTRICT_REFERENCES only in a package spec or object type spec.

EXCEPTION_INIT:
The pragma EXCEPTION_INIT associates an exception name with an Oracle error number.A pragma is an instruction to the Oracle compiler that tells it to do something. In this case you are telling Oracle to associate an error that you choose to a variable that you choose

SERIALLY_REUSABLE:
The pragma SERIALLY_REUSABLE indicates that the package state is needed only for the duration of one call to the server. An example could be an OCI call to the database or a stored procedure call through a database link. PRAGMA
Signifies that the statement is a pragma (compiler directive). Pragmas are processed at compile time, not at run time.

For more info and nice article about Pragma Click here

Post to Twitter  Post to Delicious  Post to Digg    Post to StumbleUpon

Categories : Oracle AOL, Oracle Applications, Scripts Oracle Tags : ,

Comments

No comments yet.


Leave a comment

(required)

(required)