0

I am trying to insert data from table A to another table B having 900+ columns, but this is failing with this error:

Failure 6706 The string contains an untranslatable character.

I found out function translate(Column using UNICODE_TO_LATIN) would solve that purpose but we have too many columns and we need to manually change it for all.

Is there any generic command available which will set the property in Teradata from Unicode to Latin for string values before running the insert ?

Any help would be appreciated.

Thanks, Debasis

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Debasis
  • 21
  • 3
  • you will need dynamic sql https://dbmstutorials.com/random_teradata/teradata-dynamic-statements.html and dbccolumns https://stackoverflow.com/questions/49013777/how-to-list-the-columns-of-a-table-in-teradata-sql – nbk Aug 15 '23 at 20:33
  • Explicitly invoking `TRANSLATE(column USING UNICODE_TO_LATIN)` will give the same 6706 error as implicit translation. `TRANSLATE(column USING UNICODE_TO_LATIN WITH ERROR)` will convert non-Latin characters to the substitution character '1A'xc or CHR(26). Then subsequent references to the target column which do implicit translation back to Unicode will fail with 6706. You can do additional processing to remove or replace the substitution characters but why not just make the target table columns UNICODE instead of LATIN? – Fred Aug 16 '23 at 00:03
  • @Fred Thanks for your response, We cannot change the target table columns as it has more than 900 columns and that is a production table. Is there any other way to take care of it by setting the property else above logic needs to be applied for all columns manually. Thanks, – Debasis Aug 16 '23 at 12:26
  • There is no request-level or connection-level option for this behavior, only column-by-column. – Fred Aug 17 '23 at 00:04
  • @Fred: Thanks , above approach worked. TRANSLATE(column USING UNICODE_TO_LATIN WITH ERROR) – Debasis Aug 17 '23 at 13:17

0 Answers0