Solved

Difference between function and procedure.

Posted on 2011-03-14
5
456 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 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
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.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Suggested Courses

636 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