@STREXT

Use the @STREXT function to extract a portion of a 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

@STREXT (<string>, <begin_position>, <end_position>)

<string>

The string from which to extract. The string can be either the name of a character column or a literal string. Enclose literals within single quote marks.

<begin_position>

The character position at which to begin extraction.

<end_position>

The character position at which to end extraction. The end position is included in the extraction.

Example

The following example uses three @STREXT functions to extract a phone number into three different columns.

AREA_CODE = @STREXT (PHONE, 1, 3),
PREFIX = @STREXT (PHONE, 4, 6),
PHONE_NO = @STREXT (PHONE, 7, 10)