ENCODING Error in Teradata v14

Database
Enthusiast

ENCODING Error in Teradata v14

Hi,

I need to convert hexadecimal value to a decimal value. FOr that purpose, I have created the following query.

SELECT ZEROIFNULL(CAST(FROM_BYTES( TO_BYTES('0' || SUBSTR(col_a ,9,5),'base16'),'base10') AS INT)) AS col_A_dec FROM table_a

I am trying to run the following query on Teradata 14. However, I am getting error as "Unsupported ENCODING Type".

The same query runs fine when I login to another database.

Please let me know if there is something I am missing.

Thanks,

Aarsh

2 REPLIES

Re: ENCODING Error in Teradata v14

Hi,

Ran into this problem and subsequentally this post today, solved it by using TRANSLATE(x USING LATIN_TO_UNICODE) to convert the hex string I wanted to convert into UNICODE.

Regards,

Mark

Enthusiast

Re: ENCODING Error in Teradata v14

It worked for me in TD13

SELECT CAST(FROM_BYTES( TO_BYTES('00000000D05BB25B724EAC3600010802','base16'),'base10') AS char(32)) AS col_A_dec

Result:

64483736560549077170505451522