UDF overloading issue

Extensibility
Enthusiast

UDF overloading issue

Hi,
I have to convert SQL server function isNumeric to teradata.
IsNumeric checks for the string in numeric format or not.( eg. sel isNumeric('123'); --ans:- 1. sel isNumeric('abc'); --ans :- 0)
isNumeric also accepts numeric value or column as its parameter(dont know why??) (eg. sel isNumeric(123); --ans:- 1)
now implementing it in teradata, a way possible is overload it with two inputs, 1st varchar datatype and 2nd integer datatype( and many other datatype like FLOAT).
and it is done.
but problem occurs when it comes to null handling.
eg. sel isNumeric(null); --cant fit best function for this.
2 REPLIES
Enthusiast

Re: UDF overloading issue

Quite so. The argument type is ambiguous. You can do something like this:

select isNumeric(cast(null as char));
Enthusiast

Re: UDF overloading issue

Thanks a lot.
so i have to edit the part where isNumeric is occuring :-)