FUNCTIONS

FUNCTIONS

A function is a module that returns a value.

 

Syntax:

Function [schema.]name [(parameter1 [,parameter2 …])]

Return return_datatype

[authid definer | current_user]

[deterministic]

[parallel_enable] is

— [declarations]

Begin

— executable statements

[Exception

— exception handlers]

End [name];

In the above authid clause defines whether the procedure will execute under the authority of the definer of the procedure or under the authority of the current user.

 Deterministic clause defines, an optimization hint that lets the system use a saved copy of the function’s return result, if available. The quety optimizer can choose whether to use the saved copy or re-call the function.

 Parallel_enable clause defines, an optimization hint that enables the function to be executed in parallel when called from within SELECT statement.

Questions