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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
"IF EXISTS" is what I will be using :-)
Many thanks again.
James.