Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2003
    Posts
    5

    Unanswered: triggers to update another database?

    can i have a trigger which will update fields in another database? and if yes, does such an approach has got some performance issues?

  2. #2
    Join Date
    Jul 2003
    Location
    Calcutta, India
    Posts
    42
    Yes you can do that and without any performance issue. Here is the syntax
    <DatabaseName>@<InformixServerName>:<TableName>

    adityanlal

  3. #3
    Join Date
    Oct 2003
    Posts
    706

    Wink

    Be careful with "no performance issues." The problem can be that triggers are executed a lot, and can trigger a whole lot more updating-activity than you really want or need. It doesn't "scale up" very well.

    The general term for this process is "replication," and it's often desirable for the actual activity that updates the slave database to be executed by a separate (daemon, or scheduled) process that runs periodically. It selects those records which are marked (in some way) as "changed," and executes the queries on the slave database to bring the records in-sync. Record-deletion is obviously a different sort of problem.

    Also bear in mind that "replication is a problem that has been thoroughly studied and solved." Maybe there is a product already out there that's designed to do this and which will solve-the-problem a whole lot quicker and more effectively than a home-grown cobblestone solution. It's worth looking at.
    ChimneySweep(R): fast, automatic
    table repair at a click of the
    mouse! http://www.sundialservices.com

  4. #4
    Join Date
    Apr 2003
    Location
    Phoenix, AZ
    Posts
    177

    Re: triggers to update another database?

    You can do this to some degree with triggers since your SQL is limited. But they can call Stored Procedures which give you increased flexibility.

    But, both DB's must be the same logging mode.
    Fred Prose

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •