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

If youre unsure in which script a sys or system-owned object is created, but you know its in a script from a specific directory, what UNIX command from that directory structure can you run to find your answer?

1837


Explain about the analyze command in oracle?

767


What is Reduced List of Values?

1877


hello friends Im doing my final year engineering in B.Tech.. one of uncle said he can provide job in his company if im good in database management. but i have only basic knowledge about database, so like to join database management course in good intuition. so friends kindly help me to get good intuition because its my future.

1977


Explain integrity constraints?

851






What are the uses of linked server and explain it in detail?

791


What is the string concatenation operator in oracle?

766


How can we create the complete backup of data in the oracle.

1882


what is the difference between substr and instr function in oracle?

783


Explain the characteristics of oracle dba?

834


Hi Can any one tell me what are the API's used in requisition import.

1675


What is merge statement used for?

739


what is meant by magic query

1927


How to create a stored function in oracle?

814


What are the general rules on data consistency?

740