Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Fri, 20 May 2005 @ 10:54:17 GMT

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

Subj:   Re: COMPRESSing spaces
From:   Victor Sokovin

  Is there any difference between  

          NAME CHAR(10)  COMPRESS '          '

          NAME CHAR(10)  COMPRESS ' '

In theory, all distinct values must be specified in the COMPRESS list. However, COMPRESS does not apply to VARCHAR/CLOB columns, and with CHAR columns the values in the column will be right-padded with blanks anyway. This means that in your NAME column, which is of the CHAR data type, you cannot have the value of ' ' (one blank). It will be right-padded to 10 blanks.

So, in this case the first expression (10 blanks) should be the right one. In my opinion, the second one (1 blank) will not do the job of compressing the column but I can't remember I have ever tested this.



  <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: 27 Dec 2016