Purpose
INSTRC() searches a string for a specified substring in Unicode complete characters and returns the starting character position of the substring.
Syntax
INSTRC(string, substring [, position [, occurrence]])
Parameters
Parameter |
Description |
|---|---|
| string | The string to search. |
| substring | The substring to search for. |
| position | Optional. The position at which the search starts. The default value is 1. If the value is negative, the function searches backward from the end of the string. |
| occurrence | Optional. The occurrence of the substring whose position is returned. The default value is 1. |
Return type
The return type is NUMBER. If the specified substring is not found, the function returns 0.
Examples
In the string éOceanBase, Base begins at the seventh Unicode complete character:
obclient> SELECT INSTRC('éOceanBase', 'Base') AS result FROM DUAL;
+--------+
| RESULT |
+--------+
| 7 |
+--------+
1 row in set