Interbase Trigger across multi databases
Brown, Diane
Diane.Brown@Cognos.COM
Wed, 2 Dec 1998 15:29:29 -0500
You wrote:
<...> I have a need to perform a trigger action that updates from
one Interbase
> database to another upon a store to a table. Has anyone achieved this? Is
> it at all possible?
>
It's not possible to do this solely by means of a trigger, since you can't
reference elements of one database from triggers in another database. (The
same holds true for views, and stored procedures (IB 4), and computed
fields, and constraints (IB 4) and various other things.) You can have a
single transaction that spans multiple databases and will use two-phase
commit automatically, but that's not quite the same thing.
However, it is possible to combine the use of triggers and InterBase
'events' to achieve the effect of cross-database triggers. The basic
approach would be to have a trigger in one database to post (or raise, or
whatever term is familiar) an event when there's something to be updated in
some other database, and a process (or processes) waiting for that event to
occur and updating the other database(s) as necessary.
I can't remember if there was ever anything written in SupportLink to
illustrate this. If you're interested I can probably dig up a more detailed
description of what's involved, including some suggestions for setting up a
persistent queue so that updates don't get lost if one database is
unavailable.
In your case, is the requirement that the update to the second database
happen right away? I'm just wondering if there are other possible solutions
(perhaps simpler to implement) that would also meet your requirements.
Regards,
db (brownd@cognos.com)
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.