Translate Function In Oracle Integration Cloud

Share

Translate Function In Oracle Integration Cloud

Oracle Integration Cloud (OIC) provides various functions to manipulate and transform data. One of these functions is the translate function, which you can use to replace values in an input string based on a lookup table.

Here’s the basic syntax for the translate function in Oracle Integration Cloud:

 
translate(input, search_characters, replace_characters)
  • input: The string you want to manipulate.
  • search_characters: The characters you want to find in the input string.
  • replace_characters: The characters you want to replace the found characters with.

Here’s an example usage of the translate function:

 
translate('12345', '123', 'abc')

This will replace ‘1’ with ‘a’, ‘2’ with ‘b’, and ‘3’ with ‘c’. The result will be ‘abc45’.

Please note that if the lengths of search_characters and replace_characters are not the same, the function behaves differently depending on the situation:

  • If search_characters is longer than replace_characters, any extra characters in search_characters will be removed from the input.
  • If replace_characters is longer than search_characters, the extra characters in replace_characters are ignored.

The translate function can be useful in scenarios where you need to perform multiple single-character replacements in a string.


Share

Leave a Reply

Your email address will not be published. Required fields are marked *