Product: ImportOmatic
Description: This solution describes how to resolve the error: 
An exception occurred in the Duplicate Search: Error 5.2: Conversion from type 'DBNull' to type 'Integer' is not valid
Environment: All
Version: All


This is happening because some records are returning possible matches, during the duplicate search, that have NULL gender values in the RE database. This usually happens when data is imported or converted, via means other than RE:Import or IOM. The database allows the records to save with NULL value, but the RE API, which we also use in IOM, cannot handle NULL values in Gender.

This is something that we can help you fix, as a service - to schedule a call, please contact Support at 888-662-8426, option 2 or

That said, if you have a SQL Administrator who can run scripts against your database, they can do this for you. This is the quick explanation of what they will need to do:


You would then replace NULL with "3" (this column takes integer values, and 3 = Unknown).

Additionally, if you are still loading data through means other than RE:Import or IOM, that process will need to be altered so that it does not insert NULL values for Gender (Sex), or an automated routine will need to be set up in the database to run the above query, and replace NULL with Unknown, or you will continue to get this error importing with IOM.

Please refer to the ImportOmatic User Guide for additional information.