combining columsn

UDA
Enthusiast

combining columsn

case when left(MM_OBJ_LOC_TXT,1) <> '/' then '/' + MM_OBJ_LOC_TXT else MM_OBJ_LOC_TXT end

i keep getting bad character format
1 REPLY
Senior Apprentice

Re: combining columsn

You shouldn't use MS SQL Server syntax in Teradata :-)

"+" is a numerical operator, but no string operator, thus there's an automatic typecast to FLOAT, which causes that error.

Don't use LEFT, it's no Standard SQL, but MS-/ODBC-SQL, which only works in SQL Assistant when
"Options->Query->Allow use of ODBC SQL extensions" is checked, but nowhere else.

case when substring(MM_OBJ_LOC_TXT from 1 for 1) <> '/' then '/' || MM_OBJ_LOC_TXT else MM_OBJ_LOC_TXT end

or

'/' || trim(leading '|' from MM_OBJ_LOC_TXT)

Dieter