Wednesday, December 31, 2008

PL/SQL compiler directives

As of the current release of PL/SQL, we have 4 directives


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.

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.

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

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

1 comment:

Anonymous said...

Rich and Good Article