Archives of the TeradataForum
Message Posted: Thu, 26 Oct 2006 @ 09:56:01 GMT
Subj: | | Re: Question about Oracle ROUND() function UDF |
|
From: | | Anomy Anom |
<-- Anonymously Posted: Wednesday, October 25, 2006 21:52 -->
It's very difficult to implement a ROUND as a generic UDF in any case, because the precision and scale of the result will depend on the
argument values, not just the argument datatypes (so "overloading" doesn't help much).
It's even more difficult when DECIMAL values are passed to/from Teradata UDFs as 64-bit integer values without any indication of the number of
digits to the right of the decimal (scale).
You might be able to write a UDF that gets passed the number of digits at the right to be rounded off (zeroed), or a collection of very
specific UDFs like ROUND_FROM_4_PLACES_TO_2. Neither approach seems very user-friendly, though.
|