Error 6706 The string contains an untranslatable character

General
Enthusiast

Error 6706 The string contains an untranslatable character

I'm running a query in Tera mode. 

My query looks something like:

select *

from dwh.tablename

where SHA256('ph5p6uTezuwr4c8aprux' || stringfield ) = '480b1ec07f9e5d2ca3e63e9f5278608ffb4b2e311b26e6970f47f9149dbc3735'

however, i tried getting around this by using this cast around the stringfield. I set the character set to the same as stringfield in tablename:

cast(stringfield as varchar(30) CHARACTER SET UNICODE CASESPECIFIC)

Unfortunately this also produces the same issue.

Can you suggest a fix?

Tags (2)
5 REPLIES
Senior Apprentice

Re: Error 6706 The string contains an untranslatable character

Does your SHA256-UDF accept Unicode?

If it's the one from GitHub it's Latin only.

But there's a solution, see https://github.com/akuroda/teradata-udf-sha2/wiki

It works fine with udf_utf16to8.

Enthusiast

Re: Error 6706 The string contains an untranslatable character

Hi Dieter, I have a couple of issues when trying this.

1. I don't have permissions to create functions

2. I couldn't locate 'udf_utf16to8' in that github

Senior Apprentice

Re: Error 6706 The string contains an untranslatable character

On the wiki page there's a link to the Unicode Tool Kit, udf_utf16to8 is part of it.

Talk to your DBA to get it installed.

Enthusiast

Re: Error 6706 The string contains an untranslatable character

Hi Dieter,

I ended up using TRANSLATE(varchar_field USING UNICODE_TO_LATIN WITH ERROR) to run the code without it erroring out. What are the disadvantages to using this as a workaround?

Teradata Employee

Re: Error 6706 The string contains an untranslatable character

The advantage is  that UNICODE_TO_LATIN WITH ERROR is a supported TRANSLATE routine by Teradata DBS engineering whereas udf_utf16to8 is supported by Teradata GSC (aka Tak Takahashi). This doesn't mean the udf has issues. It is very good, but has a different support mechanism.

The disadvantage is that you have some non-LATIN characters in your source UTF16 string which are translated to 0x1A and hence lost before encryption. I would assume you want your encryption routine to not loose data after decryption.

BTW: if you would like to see a native UTF-8 server character set in the DBS, please follow-up with your Teradata support representative.

-Dave