Procedures | Functions |
Procedures will be developed to business logics | Functions will be developed to apply some calculations |
Procedures will have 3 types of parameters i.e., IN, OUT, IN OUT | Functions will have only IN parameters |
Procedures can return more than one value using OUT parameters | Functions will always returns only value |
Procedure may return value or not | Function should return value |
Procedures cannot used with select, update, delete etc., (SQL Commands) | Functions can be used using select/update/delete etc., (SQL Commands) |
Procedure cannot assign to variable | Function can be assigned to a variable (x:=add2nos(10,20) |
Oracle Supplied package like DBMS_OUTPUT.PUT_LINE can be used in procedure | Oracle Supplied package like DBMS_OUTPUT.PUT_LINE cannot be used in functions |
UPDATE/DELETE etc can be used in procedures | UPDATE/DELETE etc cannot be used in functions directly |
Share this post:
on Facebook
on Google+
Post Views: 436