Function
A function is a named PL/SQL Block like as the procedure, and a Function must always return a value. Using CREATE FUNCTION statement to create a standalone stored function or a call specification. A stored function (also called a user function or user defined function) is a set of PL/SQL statements you can call by name. stored functions are very similar to procedures, except that a function returns a value to the environment in which it is called. User functions can be used as part of a SQL expression.
Syntax of create function
Create (or replace) Function function_name[parameters]
Return return_datatype;
Is
Declaration_part
Begin
Execution_part
Return return_variable;
Exeception
Exeception_part
Return return_variable;
End;
Return Type: The header section defines the return type of the fuction. The return data type can be any of the data type like varchar, number etc.
No comments:
Post a Comment