INSTRC

INSTRC is an SQL function used to perform case-sensitive searches for a specific substring within a string, returning its position if found and zero if not. The difference between INSTR and INSTRC is that the latter uses Unicode complete characters, providing accurate results when working with multibyte character data.

Example

SELECT INSTRC('òáôíõæå', 'ô') FROM dual;

Output

3

Explanation

The INSTRC function in Oracle returns the position of the first occurrence of a substring in a string. Here it is used to locate the position of the character ‘ô’ in the string ‘òáôíõæå’. Since ‘ô’ is the third character in the string, the output is 3.

For in-depth explanations and examples SQL keywords where you write your SQL, install our extension.