INSTR4 scalar function

The INSTR4 function returns the starting position, in 32-bit UTF-32 string units (CODEUNITS32), of a string within another string.

Read syntax diagramSkip visual syntax diagramINSTR4(source-string, search-string ,start,instance )

The schema is SYSIBM.

source-string
An expression that specifies the string in which the search is to take place.
search-string
An expression that specifies the string that is the object of the search.
start
An expression that specifies the position within source-string at which the search for a match is to start.
instance
An expression that specifies which instance of search-string to search for within source-string.

The INSTR4 scalar function invoked with character or graphic strings as the first two arguments is equivalent to invoking the LOCATE_IN_STRING function with CODEUNITS32 specified. The INSTR4 scalar function invoked with binary strings as the first two arguments is equivalent to invoking the LOCATE_IN_STRING function without a string units argument.