1

I am using Teradata SQLA 14.01 and want to use the OTRANSLATE function, but it is not working. I have checked the DBC.FunctionsV table to ensure that the function is defined in the system, which it is. However, even when I use the sample code;

    SELECT OTRANSLATE('TD13.0 is the current database version','3', '4');

I am faced with a 3706 error:

Syntax error: expected something between '(' and the string 'T' keyword.

All help will be greatly appreciated!!

ArK
  • 20,698
  • 67
  • 109
  • 136
dcleere
  • 11
  • 4
  • This should work as-is. Check DBC.FunctionsV if there's another function with the same name in your current database or syslib. – dnoeth Apr 28 '15 at 13:11
  • Thanks Dieter, The function name belongs in the systec database.. Should it be in the syslib database for it to work? Please forgive my ignorance if this is a stupid question! – dcleere Apr 28 '15 at 14:32
  • I believe that all the system functions should be in `TD_SYSFNLIB`. Try running it fully qualified:`SELECT td_sysfnlib.OTRANSLATE ('TD13.0 is the current database version', '3', '4');`. – Andrew Apr 28 '15 at 15:18
  • Well, there you go then. As @dnoeth suggested, you must have a UDF in your `SYSTEC` database named `OTRANSLATE`. Which is a terrible idea... You can either get rid of/rename the UDF, or fully qualify every single call to the original. – Andrew Apr 28 '15 at 15:34
  • Systec is not a Teradata defined database, oTranslate should be in td_sysfnlib. Check your Teradata version: `SEL * FROM DBC.DbcInfoV` should return a version >= 14. If it's pre-TD14 it's not built-in and you might have only a version for LATIN data and it fails for UNICODE strings – dnoeth Apr 28 '15 at 16:04
  • @dnoeth thanks for your help! My version of Teradata is 13.1 so you are right about that.. Will this function work if I translate the string from UNICODE into LATIN? Thanks again! – dcleere Apr 28 '15 at 16:17
  • Translate should work (OTRANSLATE(TRANSLATE('TD13.0 is the current database version' USING Unicode_to_latin),'3', '4'), but if your column actually holds Unicode data the translate will fail. You better ask TD Customer Service to get a Unicode version of oTranslate. – dnoeth Apr 28 '15 at 16:28

0 Answers0