Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 15 Jul 2013 @ 20:27:55 GMT


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


Subj:   Re: Checking for numeric characters in each row of a particular column
 
From:   Dieter Noeth

anne.k.kearney wrote:

  One of our users is querying a production table and for a specific column (this column is of variable length and is a mixture of numerical and alpha characters) they wish to test, for each row, does it have less than or equal to 6 numerical characters.  


What's your Teradata release?

If there a OTranslate function (builtin in TD14, before it's one of the optional Oracle UDFs):

     CASE
        WHEN CHAR_LENGTH(col) - 6
          >= CHAR_LENGTH(OTRANSLATE(col, '0123456789', '')
        THEN 1
        ELSE 0
     END

Dieter



     
  <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: 23 Jun 2019