Answer Posted / mk
Function:-
A function is a predefined action which can consumed so that
retrieve the information from table in various scenario .
Procedure :-
procedure are SQl and PL/SQL code compile and stored in the
database.
Difference
Procedure
It may or may Not return a value
It can return multiple value also
It has both Input & output parameter
Doesn’t uses return statement for returning a value
Output Parameter will be specify using Output Clause
This allow select as well as DML operation
It support Transaction mgmt and error-handling using TRY and
Catch Block
They can call another procedure and function for Execution
Function
Function
It Must return a value
It can return only single value
It has both Input parameter
Uses return statement for returning a value
Output Parameter will be specify using Return Clause
This allow select as statement
Doesn’t support Transaction mgmt and error-handling using
TRY and Catch Block
They can call only another function for Execution
When will use :-
We will use procedure to perform complex business Logic as
well as we use function while performing simple
mathematical calculation.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How to find the duplicate rows count from employees table in oracle?
What is snapshot is too old? Give and example for better understand.
Which is faster join or subquery in oracle?
How to compare dates in oracle sql?
How to define a cusotmer as a supplier in ORACLE R12
What do you mean by a deadlock?
Explain the use of ignore option in imp command.
What is the difference between count (*), count (expression), count (distinct expression)?
Give the different types of rollback segments.
Can we commit inside a function in oracle?
How to initialize variables with default values?
What is the recommended interval at which to run statspack snapshots, and why?
What is sequence?
How to execute a stored procedure in oracle?
How to list all tables in your schema?