Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Trigger question
Thu, Apr 23 2009 10:48 AMPermanent Link

"James Relyea"
I'm doing some final data validation with "before" triggers. If they =
fail the validation, is there any way to cancel the SQL execution? I'm =
familiar with something like "Instead Of" trigger functionality.

Essentially at the moment, I have to ensure certain records to not get =
deleted. If someone attempts a deletion, a before delete trigger fires. =
The trigger verifies the deletion is not for 1 of the "golden" records. =
I'm trying to figure out how to scrap the deletion of the record is not =
supposed to be deleted.=20

I could probably change the field value in the where clause of the =
delete statement to an invalid value and the delete would continue but =
wind up deleting nothing; this seems like a really sloppy way though =
because the engine still has to search for the matching record to the =
where clause. I don't want to do it this way.


thanks

Smile
jr
Thu, Apr 23 2009 4:58 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

James,

<< I'm doing some final data validation with "before" triggers. If they fail
the validation, is there any way to cancel the SQL execution? >>

Sure, just raise an exception in the trigger:

http://www.elevatesoft.com/manual?action=mantopic&id=edb2sql&category=13&topic=224

--
Tim Young
Elevate Software
www.elevatesoft.com

Image