Archives of the TeradataForum
Message Posted: Wed, 12 Sep 2012 @ 23:47:22 GMT
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
|