Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

a character string failed conversion to a numeric value

Tags:

teradata

I am just trying to add the letter A to the beginning of the results Im bring back and I keep getting this message. Query Failed. 3535 a character string failed conversion to a numeric value Thanks for any help.

select
            a.area_cd  as CO_Area 
            , 'A' +  a.area_cd
 from intDDt.DIXX a
like image 957
Matt Avatar asked Mar 05 '26 00:03

Matt


1 Answers

+ is a numeric operator in Standard SQL and Teradata and not a string concat (as in MS SQL Server). You need to use || instead:

'A' || TRIM(a.area_cd)

The TRIM results in an automatic typecast.

like image 91
dnoeth Avatar answered Mar 08 '26 20:03

dnoeth



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!