Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 15 Sep 2009 @ 14:15:50 GMT


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


Subj:   Re: INTEGER to VARCHAR data conversion strange
 
From:   Joerg Mutsch

Dirk, Prahlad,

since you are trying to insert a different DataType into your Table I strongly recommend to cast your values.

I also would recommend to use the Columnnames on the Insert section of your Insert / Select (even if the structure and the namings are the same; I saw some strange behaving here).

I would do the following:

Insert the Integer Values as described into your first Table.

Then insert the Integer values into the Varchar Table like

     INS a INTO user_work.x
     SEL cast(a as VARCHAR(20)) FROM user_work.i;

or

     INS a INTO user_work.x
     SEL a (VARCHAR(10)) FROM user_work.i;

This should work (haven't tried it though).

I am not sure why you have a different length on the Character but I assume it's also related to the missing casting. I always would recommend that.


Thanks

Joerg



     
  <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