Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Sat, 17 May 2008 @ 15:08:55 GMT


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


Subj:   Filter and convert alphanumeric data to numeric data
 
From:   Goli, Srikanth

Hi -

I expected hex conversion of upper or lower on numericals to be the same. I am running version V2R.06.01.01.106.

     sel char2hexint (lower ('1234')) ,
         char2hexint (upper ('1234')) ,
         case when (char2hexint (lower ('1234') ) = char2hexint ( upper ('1234')) )
              then 'Same' else 'Different'
              End Compare


     Char2HexInt(Lower('1234'))   Char2HexInt(Upper('1234'))   Compare
     31323334                     0031003200330034             Different

I thought of this as way to select numeric only values from a field, that contains alpha-numeric values, and then convert to decimal for comparing to other fields. I intended to compare the upper and lower values of the field, assuming that if the field is all numeric, the results would be the same otherwise hex of upper and lower would be different. Though I am curious to know the rationale for the behavior, my immediate need is for a way to convert values from an alphanumeric field to numeric, after excluding non-numeric data. Any help will be appreciated. I have read posts referring to a UDF isnumeric, cannot find it on our server, so that may not be an option. Is this an add-on or part of the core DB install?


Thanks.

Srikanth



     
  <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: 27 Dec 2016