In Oracle, FUNCTION is simply a group of PL/SQL statements. The Oracle procedure are similar to any other language routine. It accept three types of parameters IN, OUT and IN OUT. you can create your own procedures in Oracle.
A function is a subprogram that is used to return a single value. You must declare and define a function before invoking it. It can be declared and defined at a same time or can be declared first and defined later in the same block. Just as you can in other languages, you can create your own functions in Oracle.To create a new Procedure, use the following syntax:
Parameters:
In Oracle Procedure, there are three types of parameters that can be declared:
IN: This is a default parameter. This parameter can be referenced, but value can not be overwritten by the procedure or function.
OUT: This must be specified. This parameter can not be referenced, but the value of the parameter can be overwritten by the procedure or function.
IN OUT: This must be specified. This parameter can be referenced and the value of the parameter can be overwritten by the procedure or function.
Note:
In the above example, we have created a "userInsert" procedure, accept one parameter called "name_in". It has one parameter called name_in. The procedure will lookup the course_number based on course name. It then inserts a new record into the "tblUser" table.
To drop a Procedure, use Oracle DROP Procedure Statement, use the following syntax:
Parameters:
procedure_name: The name of the Procedure that you wish to delete.
Note:
In the above example, it would drop/delete the Oracle Procedure called userInsert.