difference between procedures and function?

Answer Posted / quesanswer

1. Functions must return a value(scalar,inline table or
multi statement table) whereas stored proc may or may not
retun a value.
2.Functions can return a table whereas stored procs can
create a table but can't return table.
3. Stored procs can be called independently using exec
keyword whereas function are called using select statements.
4. Stored procs can be used to change server
configuration(in terms of security-i.e. setting granular
permissions of user rights) whereas function can't be used
for this
5. XML and output parameters can't be passed to functions
whereas it can be with sp's.
6.transaction related statement can be handled in sp whereas
it can't be in function.
7. stored procedures can call a funtion or another sstored
proc similarly a function can call another function and a
stored proc.The catch with function is that no user defined
stored proc can be called.Only extended/system defined procs
can be called.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to check the server version in oracle?

812


What are the tools for Oracle ?

792


Explain the use of constraints option in exp command.

758


What is oracle analytical function?

728


How to get the Installed Oracle Version Information ?

836


Explain the use of ignore option in imp command.

757


What is oracle host variable?

697


What are the advantages of oracle 12c?

808


How do I call oracle stored procedures that take no parameters?

769


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

780


Calculate difference between 2 date / times in oracle sql?

779


Explain oracle insert into command?

833


WHEN CURSOR MOVES FROM ONE FORM TO ANOTHER FORM, HOW MANY TRIGGER WILL BE FIRED AND WHAT ARE THEIR SEQUENCE?

1984


What are the original export and import utilities?

752


What is the difference between hot backup and cold backup in oracle? Tell about their benefits also.

739