Unique and primary key constraint violation

When a unique or primary key constraint is violated, the IBM® Informix® driver returns -268 if the database uses transaction logging, and -239 if the database uses no logging.

Regarding non-Informix drivers, all 2.21 drivers now return SQLCA.SQLCODE -268 when a unique constraint or primary key constraint is violated. Before 2.21, the Oracle and SQL Server / Sybase drivers returned error -239, which is only returned by IBM Informix databases without transaction logging. Returning error -268 for all drivers is the best choice in a context of transactional databases.

Check your code for -239 error code usage and replace by -268. If you still need to test error -239 (for example because you have IBM Informix databases without transactions), we recommend that you write a function testing different error codes to check unique constraint violation:
FUNCTION isUniqueConstraintError()
   IF (SQLCA.SQLCODE==-239 OR SQLCA.SQLCODE==-268)
   OR (SQLCA.SQLCODE==-346 AND SQLCA.SQLERRD[2]==-100)
   THEN
       RETURN TRUE
   ELSE
       RETURN FALSE
   END IF
END FUNCTION