Progress
Programming
Handbook


REPLICATION–WRITE Schema Trigger Example

REPLICATION–WRITE triggers execute just after Progress fires any applicable DELETE triggers. Here is an example of one:

/* custwrr.p */ 
TRIGGER PROCEDURE FOR REPLICATION-WRITE OF Customer OLD BUFFER oldbuf. 
CREATE Replication. 
ASSIGN 
      Replication.Entry-Id = NEXT-VALUE(Replication-entry) 
      Replication.Table-Name = "Customer" 
      Replication.Task-Id = DBTASKID(LDBNAME(BUFFER Replication)) 
      Replication.Repl-Event = "Write" 
      Replication.Key-Val = STRING(IF NEW(Customer) THEN Customer.Cust-num 
            ELSE oldbuf.Cust-num). 
RAW-TRANSFER Customer TO Replication.Record. 

This REPLICATION–WRITE trigger captures all the information on a newly-modified Customer record you need in order to replicate the modify. For more information, see the section "Implementing Trigger-based Replication."


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095