Subject Re: [firebird-support] Re: How to INSERT from a TRIGGER into another database?
Author Milan Babuskov
rekkod wrote:
> The only problem is that I can't send any data when I do a POST_EVENT.

Correctly. You need to poll for data.

> I would like to log all changes in my production db into another
> seperate logging database:
>
> POST_EVENT LOG_DATA
> || 'MY_TABLE,FIELD1,FIELD1_OLD_VALUE,FIELD1_NEW_VALUE'
>
> The external app will then receive the event and log the change that
> occurred on FIELD1 in MY_TABLE in the log-database.
>
> I can of course log the change in a LOG table in my production database
> and when the external logging app receives the event LOG_DATA it will
> rad the records in the LOG table in the prod. db and INSERT it into the
> logging database and then delete it from the LOG table in the
> production db..... but this will take a long time, and will also have
> an a time-effect on my production database and production application.

I don't think it's *that* slow, but ok.

> Do you have any suggestions?

Perhaps you could use the external table, log (insert) into it, and
simply read it with the other application as a regular textual file.

It should work even faster.

--
Milan Babuskov
http://www.flamerobin.org