Subject RE: [firebird-support] Re: multiple inserts in trigger
Author Ross Ryding
Hello Sasha,
I have made it work inside one trigger, the object of the trigger is to
record changes in Sales and Work Orders and thus the trigger tests for
changes on fields and record change to the AUDIT file. I have no
understanding why it works fine without the begin and end but the end result
is good code so no worries I guess, but something is up with BEGIN and END
in 1.5

-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Sasha
Sent: Wednesday, July 11, 2007 10:46 AM
To: firebird-support@yahoogroups.com
Subject: RE: [firebird-support] Re: multiple inserts in trigger

> Does anyone know how expensive it is to fire off 50 triggers
> on an update
> that do a single insert to a table as oppose to inline code
> that tests for
> 50 cases and one trigger fired? Is firing a trigger in
> firebird lightweight
> of heavy?
>

I don't understand exactly what you are trying to accomplish but rule of
thumb is to have your code inside tha database against client code. That way
you avoid network traffic and gain speed and maintainability.

On the other hand, 50 triggers probably means you should consider
redesigning your database. Of course, that might not be an option for you
but be aware that you will hardly get any performance by patchworking bad
design.
Those are just recomendations, nobody can really tell you what will work
best for you. In any case, you need to test it in *your* real environment.

And as for your original problem, it should work so don't give up so easily.
You could provide us with some minimal test script that will create the
database and setup a test case for problematic trigger.

Sasha



++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Yahoo! Groups Links