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_charactersis longer thanreplace_characters, any extra characters insearch_characterswill be removed from theinput. - If
replace_charactersis longer thansearch_characters, the extra characters inreplace_charactersare ignored.
The translate function can be useful in scenarios where you need to perform multiple single-character replacements in a string.