7.123 REPLACEBADCHAR

Valid For

Extract and Replicat

Description

Use the REPLACEBADCHAR parameter to control the response of the process when a valid code point does not exist for either the source or target character set when mapping character-type columns. By default, the check for invalid code points is only performed when the source and target databases have different character sets, and the default response is to abend. You can use the FORCECHECK option to force the process to check for invalid code points when the source and target databases have the same character set. REPLACEBADCHAR applies globally.

Default

ABORT

Syntax

REPLACEBADCHAR {ABORT | SKIP | ESCAPE | SUBSTITUTE string | NULL | SPACE} [FORCECHECK] [NOWARNING]
ABORT

The process abends on an invalid code point. This is the default.

SKIP

The process skips the record that has the invalid code point. Use this option with caution, because skipping a record can cause data discrepancies on the target.

ESCAPE

The process replaces the data value with an escaped version of the data value. Depending on the character set of the source database, the value is output as one of the following:

  • If the source data is not UTF-16 (NCHAR/NVARCHAR), the output is hexadecimal (\xXX).

  • If the source data is UTF-16, the output is Unicode (\uXXXX).

SUBSTITUTE string

The process replaces the data with a specified string, either Unicode notation or up to four characters. By default the default substitution character of the target character set is used for replacement.

NULL

The process replaces an invalid character with the value of NULL if the target column is nullable or, otherwise, assigns a white space (U+0020).

SPACE

The process replaces an invalid character with a white space (U+0020).

FORCECHECK

The process checks for invalid code points when the source and target databases have identical character sets. This overrides the default, where the validation is skipped when the source and target character sets are identical.

NOWARNING

The process suppresses warning messages related to conversion and validation errors.

Examples

Example 1   

The following example replaces invalid code points with the value of NULL.

REPLACEBADCHAR NULL
Example 2   

Because ESCAPE is specified, Oracle GoldenGate will replace the Euro symbol in a source NCHAR column with the escaped version of u20AC, because the target is ISO-8859-1, which does not support the Euro code point.

REPLACEBADCHAR ESCAPE
Example 3   

The following substitutes a control character for invalid characters.

REPLACEBADCHAR SUBSTITUTE \u001A