Search code examples
castingintegervarcharteradata

cast varchar to integer in teradata


I have a column which is defined as varchar(19). So it can have alpha-numeric values.I have cast it to integer. Simple casting will give overflow exception and if I am tring to format it as Z(9) or '999999999' it shows error saying column has combination of numeric, character and GRAPHIC values

I have another casting too for which the column is defined as decimal(13,3) and I need to convert it to integer..I am clue less here too.

Any ideas guys??


Solution

  • VARCHAR(19) would exceed the upper boundary of the INTEGER data type in Teradata.

    Try BIGINT or DECIMAL(19,0) instead.