Subject | Re: [firebird-support] a doubt about "cascade" triggers & exceptions |
---|---|
Author | Martijn Tonies |
Post date | 2008-07-30T14:08:33Z |
> Hello, I want to do some AFTER_DELETE triggers ondone.
> some tables to clean some other tables and to check if the delete can be
>depending on
> TABLE1_AFTER_DELETE runs a delete on TABLE2 or raises an exception,
> some condition.Yes, UNLESS you've got an exception handling block in your trigger that
>
> TABLE2_AFTER_DELETE runs a delete on TABLE3 or raises an exception...
>
> if TABLE3_AFTER_DELETE raises an exception, would all the previous delete
> statement be rolled back?
catches your exception and eats it. Yummy.
> By the way: which is the best way to do this task? ISTR (don't rememberwhere
> I read it) that is better to use triggers than foreign key to mantain theDB
> consistence. Is it right? Or should I create all FK for this cases?Personally, I mostly use FKs.
>And with FK,Yes.
> a fail in the last delete, would rollback al the previous ones?
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com