In Oracle, the INSTR()
function searches for a substring in a given string, and returns an integer indicating the position of the first character of this substring. If the substring isn’t found, the function returns 0
.
INSTR()
requires at least two arguments; the string, and the substring. It also accepts an optional third and fourth arguments that allows you to specify the starting position to search, and which occurrence to search for.
INSTR()
can also be thought of as a group of functions. There are five separate functions; INSTR()
, INSTRB()
, INSTRC()
, INSTR2()
, and INSTR4()
. Each function calculates the length in a different way.
Continue reading →