Ticker

6/recent/ticker-posts

Difference Between Function and Procedure in PL/SQL

In this Tutorial, We will explore the Difference Between Function and Procedure in PL/SQL.

Difference Between Function and Procedure in Oracle

What is Difference Between Function and Procedure in Oracle PL/SQL

Function:-

  1. Function must always return a value.
  2. Function can be used in SQL statement.
  3. Function used for computational purpose.
  4. We can not write directly DML statements in Function(Using Autonomous transaction we can write DML statement in Function).
  5. In function, We use RETURN keyword for return the value.

Procedure:-

  1. Procedure can not return value but using IN and INOUT parameter procedure can return the value.
  2. We can not run procedure in SQL statement.
  3. Procedure is basically use for the bussiness logic.
  4. In procedure, we can write DML statement.
  5. 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/SQLpost will be helpful for you. If you like the post then share your view in the comment box.

Post a Comment

0 Comments