What are main difference between Stored Procedure and
Functions.

Answer Posted / hemanth

1) functions are used for computations where as procedures
can be used for performing business logic

2) functions MUST return a value, procedures need not be.

3) you can have DML(insert, update, delete) statements in a
function. But, you cannot call such a function in a SQL query..
eg: suppose, if u have a function that is updating a table..
you can't call that function in any sql query.
- select myFunction(field) from sometable;
will throw error.
4)We can call a function from a procedure, but it is not
possible to call a procedure from a function

Is This Answer Correct ?    6 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is meant by magic query

1773


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

590


Give the advantages and disadvantages of clusters.

579


What is coalesce function?

575


What is background process in Oracle?

626






How to retrieve data from an cursor to a record?

563


How do you find out from the RMAN catalog if a particular archive log has been backed-up?

1661


if you ctreate table identity

1847


List the various oracle database objects?

599


How can you use check constraints for self referential integrity?

524


How to rename an index in oracle?

616


Briefly explain what is literal? Give an example where it can be used?

544


Is there any way to find out when one specific table/view/M-view is used last time. i.e. when one specific object is used in any SELECT statement.

859


What is ordinary table in oracle?

652


What is the use of oracle?

557