Using a trigger to ensure uniqueness (4 replies)

This Comment will be submitted for moderation and will not be accessible to other users until it has been approved.
Submitted by programmer on Tue, 08/12/2008 - 09:01.

Hello,

I want to ensure that rows inserted into a database table are unique based upon a set of keys (more than the 16 allowed by my version of mysql for PKs).

I am new to triggers and do not know how to implement a trigger that would perform such a check.

Can anyone please help? Code samples or links welcome.

Thanks in advance,

Julien.

Post Comment

  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.