2011-09-13

Teradata - Data type casting examples

select
      T1.*
      , cast( number1 as decimal(18,2) ) as number1_casted
      , cast( numbertext as decimal(18,2) ) as numbertext_casted
      , cast( numbernull as decimal(18,2) ) as numbernull_casted
from
      (
            select 
                  0 as number1
                  ,'1' as numbertext
                  , null as numbernull
      ) as T1
;
--> Conclusion: nulls get cast as null.

No comments:

Post a Comment