MSCEWI2050
Translate function has different behavior in certain cases
Last updated
Translate function has different behavior in certain cases
Last updated
This is a deprecated version of the SnowConvert documentation, please visit the official site .
Low
In most cases, OTRANSLATE Teradata function and Snowflake TRANSLATE show the same behavior.
However, the following two cases should be considered:
When the second parameter of OTRANSLATE function (the string containing the characters to replace) is NULL the function returns the original string. In Snowflake any NULL parameter sent to the function causes the result to be NULL. Example:
Teradata:
Snowflake:
When the third parameter (string with the new characters to replace) is longer than the second parameter, OTRANSLATE ignores the extra characters and performs the replacements as expected. In Snowflake this case is forbidden and will generate an error. Example:
Teradata:
Snowflake:
Try to include only the necessary amount of characters in the third parameter, they are ignored in Teradata anyway and cause errors in Snowflake.
When passing expressions that evaluate to string to this function try to avoid expressions that can evaluate to NULL, at least in the second parameter.
If you need more support, you can email us at