What is pragma in oracle




















Asserts that the subprogram can be trusted not to violate one or more rules. When you specify TRUST, the subprogram body is not checked for violations of the constraints listed in the pragma. The subprogram is trusted not to violate them.

Skipping these checks can improve performance. About It:. Example: declaring restrict reference with autonomous transaction:. TRUST: This state is something, which is not checking the subprogram body whether it is violating the constraint imposed by pragma or not. A pragma is a compiler directive that is processed at compile time, not at run time. That lets you refer to any internal exception by name and to write a specific handler for it.

When you see an error stack, or sequence of error messages, the one on top is the one that you can trap and handle. We can provide a name to this exception and handle it in the exception section as given below. About It: Once started, an autonomous transaction is fully independent. It shares no locks, resources, or commit-dependencies with the main transaction.

You can log events, increment retry counters, and so on, even if the main transaction rolls back. Changes made by an autonomous transaction become visible to other transactions when the autonomous transaction commits.

If an autonomous transaction attempts to access a resource held by the main transaction which cannot resume until the autonomous routine exits , a deadlock can occur. End of the execution section of the block. Oracle Training from Don Burleson The best on site " Oracle training classes " are just a phone call away!

You can get personalized Oracle training by Donald Burleson, right at your shop! Burleson is the American Team Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals. Feel free to ask questions on our Oracle forum. Verify experience! You can log events, increment retry counters, and so on, even if the main transaction rolls back.

Changes made by an autonomous transaction become visible to other transactions when the autonomous transaction commits. In the main transaction, rolling back to a savepoint located before the call to the autonomous subprogram does not roll back the autonomous transaction.

Remember, autonomous transactions are fully independent of the main transaction. In some situations, only functions that guarantee those restrictions can be used. The same rules that apply to the function itself also apply to any functions or procedures that it calls.

If any SQL statement inside the function body violates a rule, you get an error at run time when the statement is parsed. Functions that do any of these read or write operations are difficult to optimize, because any call might produce different results or encounter errors. To call a function from parallel queries, you must specify all four constraints. No constraint implies another. When you specify TRUST , the function body is not checked for violations of the constraints listed in the pragma.

The function is trusted not to violate them. Skipping these checks can improve performance. If you specify DEFAULT instead of a subprogram name, the pragma applies to all subprograms in the package spec or object type spec including the system-defined constructor for object types. You can still declare the pragma for individual subprograms, overriding the default pragma.



0コメント

  • 1000 / 1000