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

Home -> Community -> Usenet -> c.d.o.server -> Re: Datatype in stored functions

Re: Datatype in stored functions

From: Hans Sauren <hsauren_at_gruen-ag.de>
Date: Tue, 19 Aug 2003 15:14:15 +0200
Message-ID: <bht7r6$mrh$1@online.de>


"Noons" <wizofoz2k_at_yahoo.com.au> schrieb im Newsbeitrag news:3f41f567$1$10357$afc38c87_at_news.optusnet.com.au...
> "Hans Sauren" <hsauren_at_gruen-ag.de> wrote in message
news:bhsp0u$8kf$1_at_online.de...
>
> > I've created a stored function empty(dVar DATE)... successfully. Then I
> > wanted to create a second function empty(nVar Numeric). This function
wasn't
> > created. ORACLE-message: 'name is already used by an existing object'.
Any
> > suggestion how I can do function overloading in Stored Functions of
ORACLE?
>
> Sorry, my fault. I should have given you the full story.
>
> First: I'm not sure if "empty" is not a reserved word. Check
> in the manual.
>
> Second:
> you can create overloaded functions only inside a package.
> So, you have to create a package and the functions inside
> the package. Make it an easy short name for the package
> so you don't have to type much when referencing them.
>
> The PL/SQL manual has some very good examples how to do
> this.
>
> The disadvantage is of course it's more work to create. The
> advantage is once one function is loaded and used, all the other
> overloaded functions in the same package will be ready for
> work.
>
> --
> Cheers
> Nuno Souto
> wizofoz2k_at_yahoo.com.au.nospam
>
>

Hi Nuno,
Thanks for your answer. I created a package with the function empy (it works!) with 3 different datatypes as parameters. Then I've created the package body for these 3.
So that's exactly what I was looking for.

Hans Sauren Received on Tue Aug 19 2003 - 08:14:15 CDT

Original text of this message

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