Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 01 Oct 2009 @ 13:11:06 GMT


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


Subj:   Re: Modfy data type in a table
 
From:   C, Murugavel

Try something like this...

     create table DATABASENAME.TBLNAMEi
     (
     emp_no integer
     ,Emp_salary integer
     );

     Insert into table:
     insert into DATABASENAME.TBLNAME values(1, 100); insert into DATABASENAME.TBLNAME
     values(2, 200);

Add the additional column in the table:

     ALTER TABLE DATABASENAME.TBLNAME
     ADD emp_sal_new Decimal(18,0)
     sel * from user_work.Ori

Populate the additional column from existing column:

     update
     DATABASENAME.TBLNAME
     set emp_sal_new = emp_salary

And remove the unwanted existing column:

     ALTER TABLE DATABASENAME.TBLNAME
     DROP emp_salary

Thanks & Regards,

C. Murugavel
Associate Technical Consultant
Teradata India Pvt. Ltd



     
  <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