If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > triggers to update another database?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-29-03, 12:09
aditya aditya is offline
Registered User
 
Join Date: Dec 2003
Posts: 5
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?
Reply With Quote
  #2 (permalink)  
Old 12-30-03, 07:35
adityanlal adityanlal is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 12-30-03, 11:21
sundialsvcs sundialsvcs is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 12-30-03, 16:17
fprose fprose is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On