1.1.11

SAP Note 16533 - INF239 SQL-Error: Duplicate key during DB load

Symptom:

When you load data via DBACCESS (load command) or DBLOAD or DBIMPORT, error message (INF239) is issued:
-239 Could not insert new row - duplicate value in a unique index

Cause and prerequisites

The lack of a SHORT BYTE data type in Informix, short binary values must have been stored in CHAR fields.
These require special handling during loading/unloading to be recognized as binary.
If this does not happen, varying values can be interpreted in the same way.
If these values make up a unique key, the error described above will appear.

Solution
!!!!!!!!!!!!!!!!!!!!!!!!! ATTENTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Under no circumstances use this note if you work with Informix version 7.20. The '-X' option within dbaccess is not working correctly. This can lead to severe data loss during unload/load. If you need a solution for error INF239 with Informix 7.20, please call the Hotline.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

The Informix Utilities for load/unloading (dbexport/dbimport/onunload/ onload, dbaccess unload/dbaccess load) must be called with the (undocumented) flag "-X". Thus all CHAR field will be retrieved/loaded in fix length, retaining binary values.
The individual commands are:
$dbaccess -X -
> unload to select * from ;
> load from insert into
;
>

$ dbexport -X db_name -ss
$ dbimport -X db_name
WARNING: CHAR fields can undergo an automatic converion if the Code Set
or the Hardware Platform are changed. This would change binary
values -- although not desired -- and would render the
resulting DB useless.

NOTE: Except for dbaccess (load/unload), NO Informix utility is
presently capable of executing a logical Export/Import.

No comments:

Post a Comment