Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 04 Aug 2006 @ 22:26:28 GMT


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


Subj:   Re: Missbehaving char/varchar data in teradata sql assistent
 
From:   Victor Sokovin

  It's always a question for me too, why it's the case even with VARCHAR. I know what happens with CHAR(N), fine.  


CHAR(N) are tricky but they have one advantage: fixed length.

In the example above you compare strings of different length. The literal on the right hand side is of length 6. The value in the VARCHAR column has the length of 3. 3<6. Teradata rule (as stated in, for example, Functions and Operators SQL Ref):

"Comparison of Character Strings of Unequal Length

If character strings of unequal length are being compared, the shorter of the two is padded on the right with pad characters before the comparison occurs."


The example seems to comply with this rule.


Victor



     
  <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