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: Noons <wizofoz2k_at_yahoo.com.au>
Date: Mon, 18 Aug 2003 23:44:17 +1000
Message-ID: <3f40d84c$0$10360$afc38c87@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
Received on Mon Aug 18 2003 - 08:44:17 CDT

Original text of this message

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