INSTR
- Last Updated: March 30, 2020
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
Searches character string char_expression1 for
the character string char_expression2. The search
begins at start_pos of char_expression1.
If occurrence is specified, then INSTR searches
for the nth occurrence, where n is
the value of the fourth argument.
The position (with respect
to the start of char_expression1) is returned if
a search is successful. Zero is returned if no match can be found.
Syntax
|
Notes
- The
first and second arguments must be
CHARACTERdata type. - The third and fourth arguments, if specified, must be
SMALLINTorTINYINTdata type. - The value for start position in a character string is the ordinal
number of the character in the string. The very first character
in a string is at position 1, the second character is at position
2, the
nth character is at positionn. - If you do not specify start_pos, a default value of 1 is assumed.
- If you do not specify occurrence, a default value of 1 is assumed.
- The result is
INTEGERdata type. - If any of the argument expressions evaluate to
NULL, the result isNULL. - A char_expression and the result can contain multi‑byte characters.
Example
This
example illustrates the INSTR function:
|
Compatibility
Progress extension