How to exit from before insert trigger in DB2?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • suni0718
    New Member
    • Mar 2014
    • 1

    How to exit from before insert trigger in DB2?

    My requirement is:
    I need to insert records into one table A.Before inserting it should check the newly inserting records already there in table A.If it is there it should stop insert and it should go to other insert statement.

    we will insert records into table from anywhere like java...
    But the duplicates checking and insert stopping should happen inside DB2 trigger.

    Can you please tell me possible solution for this?
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Put a unique index on the field, no need to use a trigger to check uniqueness.

    Comment

    Working...