INSTR | oracle instr
SyntaxDescriptionoftheillustrationinstr.gifPurposeTheINSTRfunctionssearchstringforsubstring.Thefunctionreturnsanintegerindicatingthepositionofthecharacterinstringthatisthefirstcharacterofthisoccurrence.INSTRcalculatesstringsusingcharactersasdefinedbytheinputcharacterset.INSTRBusesbytesinsteadofcharacters.INSTRCusesUnicodecompletecharacters.INSTR2usesUCS2codepoints.INSTR4usesUCS4codepoints.positionisannonzerointegerindicatingthecharacterofstringwhereOracleDatabasebeginsthesearch.Ifpositionisn...
Syntax
Description of the illustration instr.gifPurpose
The INSTR functions search string for substring. The function returns an integer indicating the position of the character in string that is the first character of this occurrence. INSTR calculates strings using characters as defined by the input character set. INSTRB uses bytes instead of characters. INSTRC uses Unicode complete characters. INSTR2 uses UCS2 code points. INSTR4 uses UCS4 code points.
position is an nonzero integer indicating the character of string where Oracle Database begins the search. If position is negative, then Oracle counts backward from the end of string and then searches backward from the resulting position.
occurrence is an integer indicating which occurrence of string Oracle should search for. The value of occurrence must be positive.
Both string and substring can be any of the datatypes CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB,...