Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Strange behavior while moving data from Integer columns to Varchar columns - response (1) by M.Saeed Khurram

$
0
0

Hi,
 
It is not the strange behaviour rather it is default behaviour. An when an intger is converted to varchar, it requires 11 characters for representation. So when you try to insert the integer into varchar it is converted and trimmed the from 11 char converted value to 10 char. the value 1 comes at most right and is trimmed off.
 
 
So in order to avoid this truncation, you can either cast the id explicitly to VARCHAR(10). Or use the VARCHAR(11) data type while defining the column.
Hope it helps!
 
 


Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>