Functions
Like a procedure, a function is also a derivative of a PL/SQL block structure which is physically stored within a database. Unlike procedures, they are the "workforce" in PL/SQL and meant for calculative and computational activities in the applications.
The characteristics of functions are as follows:
- Functions can be called from SQL statements (
SELECT
and DMLs). Such functions must accept onlyIN
parameters of valid SQL types. Alternatively, a function can also be invoked fromSELECT
statements if the function body obeys the database purity rules. - Functions can accept parameters in all three modes (
IN
,OUT
, andIN
OUT
) and mandatorily return a value. The type of the return value must be a valid SQL data type (not be ofBOOLEAN
,RECORD ...
Get Oracle Advanced PL/SQL Developer Professional Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.