Oracle Function by examples
Functions are another type of stored code and are very similar to procedures. The significant difference is that a function is a PL/SQL block that returns a single value. Functions can accept one, many, or no parameters, but a function must have a return clause in the executable section of the function. The datatype of the return value must be declared in the header of the function.
The syntax for creating a function is as follows:
CREATE [OR REPLACE] FUNCTION function_name
The function does not necessarily have any parameters, but it must have a RETURN value whose datatype is declared in the header.
Invoking the Function
Passing Parameter to Function
Invoking the Function with a Parameter
Use Function in Oracle Form Developer 10g