Technote Details :: Key Definition Issues

Issue

When submitting a form that inserts some information into a table, I get an error message saying: "SQL error: Duplicate entry 'InterAKT Online' for key 2.".

  • Products: All InterAKT products.

  • Operating System: All.

  • Server Models: All.

  • Dreamweaver version: any.

Reason

This happens because one of the columns into which you are inserting information is set as Unique key, and the value entered in the form already exists in the table. Either you are trying to specify a value for a Primary Key or for another user defined Index or Unique Key.

Solution

If the table column really needs to have the unique attribute, you should consider  applying the Check Unique Key trigger on the same page as the Insert form, and enter a custom error message that is explanatory to the user. The Check Unique Key trigger can be fount in the server behaviors tab > MX Kollection > Form Validation,  and automatically verifies if another entry with the same value for a column exists in the database table. If it does, the transaction is stopped, and the custom error message is displayed.


Home > Support > Knowledge Base > Technote Details
Search the Knowledge Base
© Adobe Systems Romania. All rights reserved.