Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: pl/sql function

Re: pl/sql function

From: DenHang <reply_toDenHang_at_pi.be>
Date: Tue, 23 Jul 2002 00:58:17 +0200
Message-ID: <ahi2jp$so0$1@reader12.wxs.nl>


Loss of control for one thing. If you use OUT parameters, the calling procedure looses the control over its own state.

"Rauf Sarwar" <rs_arwar_at_hotmail.com> wrote in message news:92eeeff0.0207221443.4d597c99_at_posting.google.com... > "Sybrand Bakker" <postbus_at_sybrandb.demon.nl> wrote in message news:<ujnb1jl1k4ap4a_at_corp.supernews.com>...
> > "Tim Cross" <tcross_at_nospam.une.edu.au> wrote in message
> > news:8765z88tn4.fsf_at_blind-bat.une.edu.au...
> > > "Peter" <depend3_at_yahoo.com> writes:
> > >
> > > > Is it possible to return two values when you write a function
without
> > > > concat? If yes, how do you do this?
> > > > Thanks.
> > > >
> > > >
> > > As far as I know, you can only return one "thing" - however that
> > > "thing" could be a record which contains multiple other "things" - so
> > > if you need to return two (or more) distinct values, define a record
> > > which represents the values to be returned, put those values in the
> > > record and return that.
> > >
> > > Alternatively, make one of the values you want to return an IN OUT
> > > parameter to the function call and put one value in that parameter and
> > > return the other.
> > >
> > > Tim
> > > --
> > >

> >
> > The latter of which is definitely programming with side-effects, and as
this
> > usually results in hard-to-debug programs, should be considered bad
> > programming practice. If you want to make a gordian knot of your
programs,.
> > fine with me, but please don't recommend this to others.

> >

> > Regards
>
>
> Care to elaborate on this. Are you saying that using OUT parameters in
> a function is a "bad programming practice"?
>
> Besides not being able to use in a select statement...I am curious as
> to what other "side-effects" are you referring to?
>
> file://Rauf Sarwar
Received on Mon Jul 22 2002 - 17:58:17 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US