Replacing null characters v7

Note

These options apply only to the publication server.

A character consisting of binary zeros (also called the null character string) and represented as 000 in octal or 0x00 in hexadecimal can result in errors when attempting to load such data into a Postgres character column.

You might get the following error in the Migration Toolkit log file when performing a snapshot replication of an Oracle table that contains the null character string:

Loading Table Data in 8 MB batches...
Disabling FK constraints & triggers on edb.null_test before truncate...
Truncating table NULL_TEST before data load...
Disabling indexes on edb.null_test before data load...
Loading Table: NULL_TEST ...
Error Loading Data into Table: NULL_TEST: ERROR: invalid byte sequence for encoding "UTF8": 0x00
  Where: COPY null_test, line 2

The same circumstance might also produce the following error in the Migration Toolkit log file:

Loading Table Data in 8 MB batches...
Disabling FK constraints & triggers on edb.null_clob before truncate...
Disabling indexes on edb.null_clob before data load...
Loading Large Objects into table: NULL_CLOB ...
[NULL_CLOB] Migrated 1 rows.
com.edb.util.PSQLException: Zero bytes may not occur in string parameters., Skipping Batch

If any of these errors occur, you can set an option that converts each null character encountered in character columns of the source tables to a space character or to any other character of your choice before loading the target tables.

Note

This option doesn't alter null characters encountered in columns with binary data types such as Oracle RAW and BLOB data types.

Set the following option:

replaceNullChar=true

This option results in the substitution of a space character for each null character encountered in the source character data. If you want to use a character other than a space character to replace each null character, use the following option in addition to replaceNullChar=true.

nullReplacementChar=<char>

<char> is a single character you want to substitute for the null character. For example, the following combination replaces each null character with the hash symbol #.

replaceNullChar=true

nullReplacementChar=#