For a retail application where each site will be running ADS and there will
be a head office where the sites will replicate sales, customer details etc
What im attempting to do is when a sale is done (Site 1) and a new record
added to the SALES table and this table is replicated (to Server), that on
the server it takes this record and updates its SALES table with the record,
but also updates the total sales figures for that customer in the CUSTOMER
table (then replicates that update back to Site 1).
Now i thought triggers would be my ticket, but having read the documentation
ive found that only the ON CONFLICT trigger can be fired when replicating
(and because there wont be an error ideally, this wont suit me).
I would like to avoid updating the customer locally, instead having the
server managing it.
Is there a way i can trigger some type of processing to be done when an
Insert is done on the SALES table to then take some of the new records
details and do an UPDATE to the CUSTOMER table ? (that does not require my
application, which lets pretend for a moment that its not written yet, to do
the processing to the CUSTOMER table itself)
Any help would be appreciated.
From: "Rick Dowling" <firstname.lastname@example.org>
Subject: Server Side Processing When Replicating
Date: Wed, 13 Dec 2006 13:13:23 +1100
Organization: Barcode Solutions
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
X-RFC2646: Format=Flowed; Original
X-Trace: 12 Dec 2006 19:09:06 -0700, 184.108.40.206
Xref: solutions.advantagedatabase.com Advantage.Replication:148
Article PK: 1134006
Subject: Re: Server Side Processing When Replicating
Date: Mon, 18 Dec 2006 16:30:34 -0000
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-Trace: 18 Dec 2006 09:27:01 -0700, 220.127.116.11
Xref: solutions.advantagedatabase.com Advantage.Replication:149
Article PK: 1134007
I'm doing the exact same scenario as you ( retail application also ). My
way is to replicate the sales from the POS site to the head office. Then
the Head office recalculates the customer balance and the customer record is
replicated down to the POS site.
So. POS site publishes sales and HO site subscribes.
HO site published customer records and POS site subscribe to changes.
both sites can have an update trigger on sales to update the customer
balances but in my case the Head Office controls the customers and can issue
credit notes etc so that it's changes overrule the POS site. I also use a
rowversion field to in another similar sceanrio indicate which customer type
records should be updated depending on sales updates by an monitoring agent