Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > Oracle
| Search | Today's Posts | Mark Forums Read
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 9th, 2007, 05:10 PM
Authorized User
Join Date: Jan 2007
Location: , , .
Posts: 46
Thanks: 2
Thanked 1 Time in 1 Post
Default Function and Procedure

What are procedures and functions in Oracle and how to convert a function into a procedure and vice versa.
Please provide examples.


Life is an endless journey towards perfection

Life is an endless journey towards perfection
Old March 26th, 2007, 01:23 AM
Friend of Wrox
Points: 793, Level: 10
Points: 793, Level: 10 Points: 793, Level: 10 Points: 793, Level: 10
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: May 2005
Location: OKC, OK, USA.
Posts: 227
Thanks: 1
Thanked 7 Times in 7 Posts

Procedures are named and stored that may or may not return a value. However, they must return the success or failure at execution time.

Functions are similar to procedures in structure, but they MUST return a single value by using the RETURN-value clause. Functions are also named and can be called from a procedure.

Hope this helps.

Disclaimer: The above comments are solely the opinion of one person and not to be construed as a directive or an incentive to commit fraudulent acts.
Old July 24th, 2007, 07:05 AM
Authorized User
Join Date: Sep 2004
Location: Edegem, Antwerpen, Belgium.
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts

NOTE: Functions can also return tables like in this sample: http://geertverhoeven.blogspot.com/2...rns-table.html

The main different is the way how to use them.

A function can be used within a query where a procedure can't.




Similar Threads
Thread Thread Starter Forum Replies Last Post
Function Procedure reneemettrie Excel VBA 0 June 13th, 2008 11:06 AM
Function used in procedure mikedeepak SQL Server 2000 3 February 13th, 2008 05:23 AM
Procedure or function has too many arguments Raby VB Databases Basics 6 November 16th, 2007 11:38 AM
Procedure or function STOREDPROC has too man rit01 ASP.NET 2.0 Basics 4 January 25th, 2006 09:51 AM
Analytical function and stored procedure akmhasan Oracle 2 November 14th, 2003 01:41 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.