Link to home
Start Free TrialLog in
Avatar of JAMES
JAMES

asked on

How do I ignore errors generated from a duplicate index insert within a trigger

Hi,

I have a legacy Adaptive Server Anywhere 6 database which i need to add a trigger to.

Within this trigger I need to add some data to a table but I dont care if the row already exists.  I dont really want to do a "select 1 from..." to test it's presence as I feel this imposes an overhead on the database.

Is there any way I can simply trap the duplicate primary key index error and ignore it?

Thanks.

James.
ASKER CERTIFIED SOLUTION
Avatar of grant300
grant300

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JAMES
JAMES

ASKER

Wow - thank you very much for taking that time to write your comments.

"IF EXISTS" is what I will be using :-)

Many thanks again.

James.