Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Difference between function and procedure.

Posted on 2011-03-14
5
Medium Priority
?
459 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 5

Expert Comment

by:mayankagarwal
ID: 35125982
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 2000 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

719 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