Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 16 Dec 2006 @ 00:41:15 GMT


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


Subj:   Re: Looking for bad data
 
From:   Vinay Bagare

Good catch Mike.

I modified for this.

     SEL
     -- '1234M' AS sno -- CHAR type
     '12%5M' AS sno -- CHAR type
     ,CASE WHEN (UPPER(SUBSTRING(TRIM(sno) FROM 1 FOR 4)) (CASESPECIFIC) =
     LOWER(SUBSTRING(TRIM(sno) FROM 1 FOR 4)) (CASESPECIFIC) )
     AND SUBSTRING(sno FROM 5 FOR 1) = 'M'
     AND CHAR2HEXINT(SUBSTRING( sno FROM 1 FOR 1)) BETWEEN '0030' AND '0039'
     AND CHAR2HEXINT(SUBSTRING( sno FROM 2 FOR 1)) BETWEEN '0030' AND '0039'
     AND CHAR2HEXINT(SUBSTRING( sno FROM 3 FOR 1)) BETWEEN '0030' AND '0039'
     AND CHAR2HEXINT(SUBSTRING( sno FROM 4 FOR 1)) BETWEEN '0030' AND '0039'
     THEN 'MATCH' ELSE 'Mis MATCH' END AS "Result"

I think this takes care of all characters.

Vinay



     
  <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