INSTR v16

The INSTR function returns the location of the nth occurrence of a given pattern in a large object.

<position> INTEGER INSTR(<lob_loc> { BLOB | CLOB },
   <pattern> { RAW | VARCHAR2 } [, <offset> INTEGER [, <nth> INTEGER ]])

Parameters

lob_loc

Large object locator of the large object in which to search for pattern.

pattern

Pattern of bytes or characters to match against the large object, lob. pattern must be RAW if lob_loc is a BLOB. pattern must be VARCHAR2 if lob_loc is a CLOB.

offset

Position in lob_loc to start search for pattern. The first byte/character is position 1. The default is 1.

nth

Search for pattern, nth number of times starting at the position given by offset. The default is 1.

position

Position in the large object where pattern appears the nth time, starting from the position given by offset.