Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 08 Aug 2011 @ 14:39:30 GMT


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


Subj:   Char column stores data with spaces
 
From:   Gagandeep Singh Chawla

Hi ,

I am finding that a char column stores data with spaces (if all characters upto the length of the column are not given) but is able to return the row when compared without giving spaces for the column.

Please explain the behavior.

PFB the script :

     Create table test_char (col1 char(3));

     Insert into test_char ( col1 ) values ('%');

     sel col1 from test_char where col1 = '%';  (Please note that there are no spaces here)

      *** Query completed. One row found. One column returned.
      *** Total elapsed time was 1 second.

     col1
     ----
     %

     sel col1 from test_char where col1 = '%  ';   (Please note the spaces here)

      *** Query completed. One row found. One column returned.
      *** Total elapsed time was 1 second.

     col1
     ----
     %

Thanks and Regards,

Gagan



     
  <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