All Forums General
Johnmghenry 11 posts Joined 04/15
16 Mar 2016
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 ) = '480b1ec07f9e5d2ca3e63e9f5278608ffb4b2e311b26e6970f47f 9149dbc3735'

 

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?

dnoeth 4628 posts Joined 11/04
16 Mar 2016

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.

Dieter

Johnmghenry 11 posts Joined 04/15
16 Mar 2016

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

dnoeth 4628 posts Joined 11/04
16 Mar 2016

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.

Dieter

Johnmghenry 11 posts Joined 04/15
18 Mar 2016

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?

david.craig 73 posts Joined 05/13
18 Mar 2016

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

You must sign in to leave a comment.