Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Thu, 08 Jan 2015 @ 15:40:22 GMT

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

Subj:   Re: Forcing character string comparision
From:   Anomy Anom

<-- Anonymously Posted: Thursday, January 08, 2015 10:32 -->

By SQL standards, trailing pad characters don't count - the shorter value is in effect padded to the length of the longer before comparison.

And fixed CHAR always adds padding up to the indicated length when the value is stored.

If you store the data as VARCHAR, you can explicitly require that the lengths match as well as the content:

     WHERE (col1 = col2 AND character_length(col1) =character_length(col2))

  <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