difference between procedures and function?

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


Please Help Members By Posting Answers For Below Questions

Explain alias?

893


How to change program global area (pga) in oracle?

827


What is set verify off in oracle?

822


How to export data to a csv file?

839


What is a database table in oracle?

758


You have found corruption in a tablespace that contains static tables that are part of a database that is in NOARCHIVE log mode. How would you restore the tablespace without losing new data in the other tablespaces?

1671


How to loop through a cursor variable?

791


How to invoke the original export import utilities?

691


i have a question here... As of my knowledge, when we apply an index (b-tree)on a column, internally it arranges the data in b-tree format and do the fetching process correspondingly... and my quetion is... How a bit-map index arranges the data internally when applied on a column?IS it in b-tree format or whatelse?

1709


What is the oracle implicit cursor?

790


State some uses of redo log files?

762


What is the difference between a primary key & a unique key?

819


What is oracle instant client?

755


What is ordinary table in oracle?

828


Can you create a synonym without having a table?

765