This Oracle tutorial explains how to use the Oracle/PLSQL INSTR4 function with syntax and examples.
The Oracle/PLSQL INSTR4 function returns the location of a substring in a string, using UCS4 code points.
The syntax for the INSTR4 function in Oracle/PLSQL is:
The string to search. string can be CHAR, VARCHAR2, NCHAR, or NVARCHAR2. string can not be CLOB or NCLOB.
The substring to search for in string. substring can be CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB.
Optional. The position in string where the search will start. If omitted, it defaults to 1. The first position in the string is 1. If the start_position is negative, the INSTR4 function counts back start_position number of characters from the end of string and then searches towards the beginning of string.
Optional. The nth appearance of substring. If omitted, it defaults to 1.
The INSTR4 function returns a numeric value. The first position in the string is 1. If substring is not found in string, then the INSTR4 function will return 0.
The INSTR4 function can be used in the following versions of Oracle/PLSQL:
Let's look at some Oracle INSTR4 function examples and explore how to use the INSTR4 function in Oracle/PLSQL.
For example: