Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Datatype in stored functions
"Noons" <wizofoz2k_at_yahoo.com.au> schrieb im Newsbeitrag
news:3f40d84c$0$10360$afc38c87_at_news.optusnet.com.au...
> "Hans Sauren" <hsauren_at_gruen-ag.de> wrote in message
news:bhqksm$gpr$1_at_online.de...
> > Hi all,
> > we have to write a stored function which tests whether a value is NULL
or 0
> > or spaces in charfields. We want to give the function a parameter with
the
> > content of the field (or possibly the result of a term). Therefore the
> > datatype of the parameter is undetermined or like SQL_VARIANT in
Microsoft
> > SQL Server). How can we implement this in ORACLE 8.1.7?
> >
>
> You don't. You use function overloading.
> As in:
>
> CREATE FUNCTION A (par1 NUMBER) as
> ...
> END A;
> CREATE FUNCTION A (par1 VARCHAR) as
> ...
> END A;
> CREATE FUNCTION A (par1 CHAR) as
> ..
> END A;
>
> and you put the appropriate code in each of the ellipsis.
>
> then you call them with the same "A" name and
> whatever parameter you want to test.
>
> HTH
> --
> Cheers
> Nuno Souto
> wizofoz2k_at_yahoo.com.au.nospam
>
>
Hi Nuno,
Thanks for your answer.
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?
Hans Sauren Received on Tue Aug 19 2003 - 04:01:18 CDT
![]() |
![]() |