Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 12 Sep 2012 @ 23:47:22 GMT


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


Subj:   Re: Insert Char values in column defined as Integer
 
From:   DUELL, BOB

If the values for COL1 in table TEST2 are character strings representing numbers, you can use the CAST function. However, if they are not numbers, you will get this error (because you cannot store a character string into an INTEGER value).

In other words, this works:

     select cast( '1234 ' as integer) as a_number

But this fails:

     select cast( 'Hello' as integer) as a_number

So, you can try:

     INSERT INTO TEST1
            (Col1)
     SELECT CAST(col1 as integer)
     FROM Test2

Bob



     
  <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