PL/SQL Instr

The Instr function returns the first position of a substring in a string.

INSTR syntax

INSTR(string , substring [, position [, occurrence]])

INSTR example

select instr('PL/SQL Reference', 'r') from dual;

Return value: 8


select instr('PL/SQL Reference', 'SQL') from dual;

Return value: 4


select instr('PL/SQL reference', 'r',1,1) from dual;

Return value: 8


select instr('PL/SQL reference', 'r',1,2) from dual;

Return value: 12