INSTR functions | oracle instr
TheINSTRfunctions(INSTR,INSTRB,INSTRC,INSTR2,andINSTR4)searchesastringforasubstringusingcharactersandreturnsthepositioninthestringthatisthefirstcharacterofaspecifiedoccurrenceofthesubstring.Thefunctionsvaryinhowtheydeterminethepositionofthesubstringtoreturn.INSTRcalculateslengthsusingcharactersasdefinedbytheinputcharacterset.INSTRBcalculateslengthsusingbytes.INSTRCcalculateslengthsusingUnicodecompletecharacters.INSTR2calculateslengthsusingUCS2codepoints.INSTR4calculateslengthsusingUCS4codepo...
The INSTR functions (INSTR, INSTRB, INSTRC, INSTR2, and INSTR4) searches a string for a substring using characters and returns the position in the string that is the first character of a specified occurrence of the substring. The functions vary in how they determine the position of the substring to return.
INSTR calculates lengths using characters as defined by the input character set.
INSTRB calculates lengths using bytes.
INSTRC calculates lengths using Unicode complete characters.
INSTR2 calculates lengths using UCS2 code points.
INSTR4 calculates lengths using UCS4 code points.
Return Value
A nonzero INTEGER when the search is successful or 0 (zero) when it is not.
Syntax
{INSTR | INSTRB | INSTRC | INSTR2 | INSTR4} (string , substring [, position [, occurrence]])
Arguments
stringThe text expressi...