What is the usage of oracle split?
The SPLIT function in Oracle is used to split a string into multiple substrings using a specified delimiter, and it returns an array containing these substrings.
The syntax of the SPLIT function is as follows:
SPLIT(string, separator [, limit])
Description of parameters:
- string: The string to be split.
- Separator: The character or string used to separate elements in a string.
- maximum number of times to split (optional)
Return value:
The SPLIT function returns an array containing the split sub strings.
Example:
“I can’t make it to the meeting on Friday due to a scheduling conflict.”
“I won’t be able to attend the meeting on Friday because of a conflicting prior commitment.”
SELECT * FROM SPLIT('Hello,World', ',');
output:
COLUMN_VALUE
------------
Hello
World
In the example above, the string ‘Hello, World’ is split into two substrings, ‘Hello’ and ‘World’, using a comma as the delimiter, and returned as an array by the SPLIT function.