In this Tutorial, We will explore the Difference Between Function and Procedure in PL/SQL.
What is Difference Between Function and Procedure in Oracle PL/SQL
Function:-
- Function must always return a value.
- Function can be used in SQL statement.
- Function used for computational purpose.
- We can not write directly DML statements in Function(Using Autonomous transaction we can write DML statement in Function).
- In function, We use RETURN keyword for return the value.
Procedure:-
- Procedure can not return value but using IN and INOUT parameter procedure can return the value.
- We can not run procedure in SQL statement.
- Procedure is basically use for the bussiness logic.
- In procedure, we can write DML statement.
- In procedure, We can use RETURN keyword also but the behaviour of RETURN keyword is change in the procedure. RETURN keyword means you want to exit to program.
That's all for today, I hope this (Difference Between Function and Procedure in Oracle PL/SQL) post will be helpful for you. If you like the post then share your view in the comment box.
0 Comments
If you have any doubts, Please let me know