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: A question on the NVL to be re cristchened to ISNULL

Re: A question on the NVL to be re cristchened to ISNULL

From: DA Morgan <damorgan_at_psoug.org>
Date: Thu, 20 Oct 2005 08:15:37 -0700
Message-ID: <1129821330.368578@yasure>


Jim Kennedy wrote:

> <bhushanvinay_at_gmail.com> wrote in message
> news:1129741943.043149.305790_at_g44g2000cwa.googlegroups.com...
> 

>>wanted to know if the oracle supported a varient datatype as to write
>>a wraper to the nvl function, i discoverd that we cannot do a synonym
>>for a system functions like NVL but nvl supports a varient datatype or
>>it may have been designed to have a functin overloading concept in
>>oracle as its a object oriented database.
>>
>>but how its developed is not my issue here can there be a varient
>>datatype which it accepts and get me the varient output.
>>
>>CREATE OR REPLACE FUNCTION ISNULL( ARG1 VARIENT, ARG2 VARIENT)
>>RETURN VARIENT IS
>>RTNVAL VARIENT;
>>BEGIN
>> RETURN NVL(ARG1,ARG2);
>>END;
>>/
>>SHOW ERRORS;
>>
>>any answers to this will be appriciated.
>>
>>Regards
>>Vinay
>>
> 
> 
> You can use function overloading.  Just define a different function (same
> name, but different datatypes) and it will work as advertised.  Oracle will
> choose the right one.
> Jim

Addendum: You can overload functions in packages and you can overload functions in use-defined operators.

-- 
Daniel A. Morgan
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Thu Oct 20 2005 - 10:15:37 CDT

Original text of this message

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