I'm running a query in Tera mode.
My query looks something like:
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.
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
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.
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?
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.