Home Page for the TeradataForum
 
 

 

Archives of the TeradataForum





Message Posted: Wed, 11 Jan 2006 @ 14:12:49 GMT





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




Subj:   Re: ALTER table to add compression
 
From:   Praveen_Chakrapani



We can add a new column with compress attribute then you have to update all the values in old to new column then remove old column and rename new column name to old column name.

      BTEQ -- Enter your DBC/SQL request or BTEQ command:
     show table t1;

     show table t1;

      *** Text of DDL statement returned.
      *** Total elapsed time was 1 second.

     ------------------------------------------------------------------
     CREATE SET TABLE CPK.t1 ,NO FALLBACK ,
          NO BEFORE JOURNAL,
          NO AFTER JOURNAL,
          CHECKSUM = DEFAULT
          (
           i FLOAT,
           j CHAR(30) CHARACTER SET LATIN NOT CASESPECIFIC,
           k INTEGER,
           s INTEGER COMPRESS 0 )
     PRIMARY INDEX ( i );


      BTEQ -- Enter your DBC/SQL request or BTEQ command:
     alter table t1 add t decimal(12,3) compress 0.0;

     alter table t1 add t decimal(12,3) compress 0.0;

      *** Table has been modified.
      *** Total elapsed time was 1 second.


      BTEQ -- Enter your DBC/SQL request or BTEQ command:
     show table t1;

     show table t1;

      *** Text of DDL statement returned.
      *** Total elapsed time was 1 second.

     ------------------------------------------------------------------
     CREATE SET TABLE CPK.t1 ,NO FALLBACK ,
          NO BEFORE JOURNAL,
          NO AFTER JOURNAL,
          CHECKSUM = DEFAULT
          (
           i FLOAT,
           j CHAR(30) CHARACTER SET LATIN NOT CASESPECIFIC,
           k INTEGER,
           s INTEGER COMPRESS 0 ,
           t DECIMAL(12,3) COMPRESS 0.000 )
     PRIMARY INDEX ( i );

Hope this helps.


Thanks,

Praveen





     
  <Prev Next>   <<First <Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
 
  Top Home Join Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky 
Last Modified: 30 Jun 2008