@STRFIND
Use the @STRFIND function to determine the position of a string within a string column or else return zero if the string is not found. Optionally, @STRFIND can accept a starting position within the string.
For this function, Oracle GoldenGate supports the use of an escape sequence to represent characters in a string column in Unicode or in the native character encoding of the Microsoft Windows, UNIX, and Linux operating systems. The target column must be a SQL Unicode data type if any argument is supplied as Unicode.
This function does not support NCHAR or NVARCHAR data types.
Syntax
@STRFIND (<string>, '<search_string>' [, <begin_position>])
<string>
The string in which to search. This can be either the name of a character column or a literal string that is within single quote marks.
<'search_string'>
The string for which to search. Enclose the search string within single quote marks.
<begin_position>
The byte position at which to begin searching.
Example
Assuming the string for the ACCT column is ABC123ABC, the following are possible results.
| Function statement | Result |
|---|---|
| `@STRFIND` (`ACCT`, '23') | 5 |
| `@STRFIND` (`ACCT`, 'ZZ') | 0 |
| `@STRFIND` (`ACCT`, '`ABC`', 2) | 7 (because the search started at the second byte) |