This content has been marked as final. Show 7 replies
976798 wrote:That's exactly the difference. A function always returns a value, whereas a procedure does not.
except return value differentiation.
why we can not call a procedure in a select statement like a pl/sql function.A function returns a value whereas the procedure doesn't. A procedure could have an out parameter, however how would you implement that in a SQL query? how would you define the out parameter variable within SQL, what would it be and where/how to define it?
thank You for replying, When we can do everything with a procedure as function then why we have a need for function.
What can you do in a procedure that you can't do in a function?
I'd say make everything a function :-)
Procedure and Function - both are built on PL/SQL code.
Depend upon you requirement you need to use either.
If you want to a calculation and want tog et the reulst back , then use function.
If you want to do a set of statement together like - select, update * insert - but do no need to get back value in your current work area, then use Procedure.
Please read the related meterial.
If you are new to oracle development , it is good to have clear mind set.
When we can do everything with a procedure as function then why we have a need for function.You can't. you can't use a procedure in a SQL Statement for example.
Thank you for your replying and suggestion...
Have a Good day..