Solved

Difference between function and procedure.

Posted on 2011-03-14
5
450 Views
Last Modified: 2012-05-11
When it is required to use a function and when we need to use procedure?
what really is the difference in terms of application or usage?
0
Comment
Question by:sakthikumar
  • 2
  • 2
5 Comments
 
LVL 5

Expert Comment

by:mayankagarwal
ID: 35125982
0
 
LVL 5

Expert Comment

by:mayankagarwal
ID: 35125990
0
 
LVL 2

Expert Comment

by:swadhinray
ID: 35125991
You can go though the OTN site and can get the details else just do a search internet you will find huge resources available like what I did:

http://www.google.co.in/#hl=en&biw=1280&bih=785&q=Difference+between+function+and+procedure+in+oracle&aq=f&aqi=g10&aql=&oq=&fp=df1008b532a3f545

0
 
LVL 28

Accepted Solution

by:
Naveen Kumar earned 500 total points
ID: 35125994
both are subroutines or code modules.

But function can return a single value at any time, so that means it can be used in expressions etc to check the returned value directly. also it can be called from sql queries.

But procedure can return any values depending on how  you code it. if you code it to return a pl/sql array then you are returning many values. If you code it to return a single out variable, then it means you are just returning one value. procedures need not always have to return values. I mean your procedure can have code without OUT variables and in this case it just means it can execute the code inside it but it cannot return some data from it in the form of variables.

Thanks
0
 
LVL 28

Expert Comment

by:Naveen Kumar
ID: 35136255
Good and thanks.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now