Data Warehousing Community Forum
The Warehouse of Data warehousing knowledge ...
Home
Help
Search
Login
Register
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
September 09, 2010, 05:57:58 am
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Light Blue
Light Navy
Light Silver
Light Turquoise
Light Green
Light Olive
Light Golden
Light Brown
Light Red
Light Rose
Light Lilac
Light Violet
Data Warehousing Community Forum
>
Databases
>
Oracle
>
PL/SQL
> Topic:
Procedure and Function?
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: Procedure and Function? (Read 564 times)
Sipra
Founder
Reputation: +35/-0
Offline
Posts: 238
I am the King...
Procedure and Function?
«
on:
July 10, 2007, 12:17:40 pm »
What is the difference between a
Procedure
and
Function
?
Is Package consists of all PL/SQL units? What is the advantage of Package when compared to a Procedure and Function?
How Procedures and Functions are called in a PL/SQL block?
Logged
Sipra
Founder
www.dwforum.net
Whoever
Administrator
Reputation: +34/-0
Offline
Posts: 114
Forum Don
Re: Procedure and Function?
«
Reply #1 on:
July 17, 2007, 11:50:22 am »
A
Function
is always returns a value using the return statement.
A
Procedure
may return one or more values through parameters or maynot return at all.
A
Package
is a PL/SQL block which contains set of Functions and Procedures.
How Procedures and Functions are called in a PL/SQL block?
Function
is called as a part of expression.
for Eg -
sal:=calulate_sal('sp207')
Procedure
is called as a PL/SQL statement
for Eg -
calculate_bonus('sp033')
Logged
You don't get it. I built this place. Down here, I make the rules. Down here, I make the threats. Down here, I'm God.
unknown
DW Apprentice
Reputation: +7/-0
Offline
Posts: 44
Re: Procedure and Function?
«
Reply #2 on:
January 19, 2008, 11:23:37 pm »
Just adding a small missed out point to Whoever's statement -
Functions are used for computations where as procedures are used for performing business logic.
Thanks
Logged
Thanks
Unknown
samishta
DW Fresher
Reputation: +2/-0
Offline
Posts: 17
Re: Procedure and Function?
«
Reply #3 on:
May 28, 2008, 11:56:30 pm »
I agree with unknown,... functions are widely used for computations, while procedures and functions both might be used for implementing complex business logic.
We can easily use functions in sql statements, ... say select queries for that matter since they are capable of returning values and thus can very easily be equated. Even the inbuilt functions like decode, nvl etc exemplify this.
Procedures dont find much use in sql statements but are used in pl blocks. They support multiple in out parameters.
Logged
Pages: [
1
]
Go Up
Print
Data Warehousing Community Forum
>
Databases
>
Oracle
>
PL/SQL
> Topic:
Procedure and Function?
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> Introductions
=> Rules
=> Anouncements & News
=> Suggestions
=> General Discussion
=> Job Opportunities
-----------------------------
Databases
-----------------------------
=> Oracle
===> PL/SQL
=> Microsoft SQL Server
=> IBM DB2
=> Teradata
-----------------------------
Data Warehousing
-----------------------------
=> Data Warehousing Concepts
=> Data Modeling
-----------------------------
ETL Tools
-----------------------------
=> Informatica
===> Installation & Configuration
=> Data Stage
=> Ab Initio
=> Oracle Warehouse Builder
=> DTS/SSIS
-----------------------------
Reporting Tools
-----------------------------
=> Business Objects
=> Cognos
=> Crystal Reports
=> Hyperion
=> Brio
=> Microstrategy
-----------------------------
Operating Systems
-----------------------------
=> UNIX / Linux
===> Unix Shell Scripting
=> Windows
-----------------------------
Other Technologies & Tools
-----------------------------
=> JAVA
-----------------------------
Guest Forum
-----------------------------
=> Guest Forum
Loading...