Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 26 Oct 2006 @ 09:56:01 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


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.



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023