Error – “Integrity Constraint Violation”

When trying to add a new card, post a sale, or import information into the POSIM database, you may encounter an error “Key Violation. [Sybase][ODBC Driver][Adaptive Server Anywhere] [Integrity Constraint violation…” This error occurs when POSIM tries to duplicate a key.

Suppose you have an Item Card that has the item ID of 1015. If you do an import to create an Item Number 1015, you will get an Integrity Violation or Duplication error.

  • Any time a new Purchase Order is created with ID equal to that of an existing Receiving Log or Processed PO, you will receive an Integrity Violation error.
    • To remedy this situation, go to Inventory>Analyzer, File, Shared User Control, click on the P.O. tab.
    • In the Shared Purchase Order Numbering section, put a check in the box under Enabled.
    • If the Enabled box already has a check mark on it, place your cursor in the PO Suffix box and increase the number. (Generally, advancing the PO Suffix about 3 to 5 numbers will correct the problem. For example, if it begins with 571, advance the number to 575.)
  • If you receive the error when attempting to post a Working Invoice, usually the program is attempting to post to a Processed Invoice ID that is already in use. To resolve this:
    • Go to Sales>Point, File, Shared User Control, and select the Register Invoice ID’s tab.
      • If you have a Centralized database, advance the P-Suffix ID 3 to 5 numbers.
      • If each register has separate Working and Processed ID’s, change the P-Suffix on the register getting the Integrity Violation error.
  • If the error occurs when opening a new Working Invoice, follow the steps as in Step 3 above, changing the W Suffix instead of the P-Suffix.
Menu