Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Functions And Procedures.

Friends, I want to know the difference between Function and Procedures in Oracle?
Difference between function & procedure?
[131 byte] By [radhika743] at [2007-11-11 10:19:07]
# 1 Re: Functions And Procedures.
From Modern Database Management 7e, Jeffrey A. Hofferand ...
Function A stored subroutine that returns one value and has only input parameters.
Procedure: A collection of procedural and SQL statements that are assigned a unique name within the schema and stored in the database.
Routines can be either procedures or functions.
Hope it helps. :)
Kinda Electroni at 2007-11-11 23:43:28 >
# 2 Re: Functions And Procedures.
What is this?

I want to know the difference between the two in ORACLE?

Please post correct Answer.

Functions vs Stored procedures (http://forums.oracle.com/forums/thread.jspa;jsessionid=8d92200630d650d260416f834a008eb2eb83e2189f85.e34Tb34Lb34PbO0Lb3eTah iPc3qSe0?messageID=547397򅩅)

To sum up,
* Functions can return one value while stored procedures can return several values [OUT parameters].
* Functions can be used within an SQL [SUM() is an example of a function which is commonly used] while a stored procedure is executed only in a separate context.
* By convention, functions are used for "read only" calls while stored procedures can have DML and DDL statements.
aniseed at 2007-11-11 23:44:28 >
# 3 Re: Functions And Procedures.
Actually a Function is a type of Procedure that can be written to return a value to a calling procedure or program. A standard Procedure, most commonly referred to as a Sub or subroutine cannot return a value.
pclement at 2007-11-11 23:45:23 >