Contents Index Synchronization logic source code Synchronizing customers in the CustDB sample

MobiLink Synchronization User's Guide
  The CustDB Sample Application
    Synchronization

Synchronizing orders in the CustDB sample


Business rules 

The business rules for the ULOrder table are as follows:

Downloads 

Orders can be inserted, deleted or updated at the consolidated database. The scripts corresponding to these operations are as follows:

SELECT o.order_id, o.cust_id, o.prod_id, o.emp_id, o.disc, o.quant, o.notes, o.status
 FROM ULOrder o, ULEmpCust ec
 WHERE o.cust_id = ec.cust_id
 AND ( ( o.status = 'Approved' AND o.last_modified > ? )
 OR ( ec.action = 'D'  )  )
 AND ec.emp_id = ?
Uploads 

Orders can be inserted, deleted or updated at the remote database. The scripts corresponding to these operations are as follows:

INSERT INTO "ULOrder" ( "order_id", "cust_id", "prod_id", "disc", "quant", "notes", "status" )
  VALUES ( ?, ?, ?, ?, ?, ?, ? )
UPDATE ULOrder SET cust_id=?, prod_id=?, emp_id=?, disc=?, quant=?, notes=?, status=?
   WHERE order_id = ?
DELETE FROM "ULOrder" WHERE "order_id" = ?
SELECT order_id, cust_id, prod_id, emp_id, disc, quant, notes, status
   FROM ULOrder WHERE order_id = ?
INSERT INTO ULOldOrder ( order_id, cust_id, prod_id, emp_id, disc, quant, notes, status )
   VALUES( ?, ?, ?, ?, ?, ?, ?, ? )
INSERT INTO ULNewOrder ( order_id, cust_id, prod_id, emp_id, disc, quant, notes, status )
   VALUES( ?, ?, ?, ?, ?, ?, ?, ? )
Conflict resolution 

Contents Index Synchronization logic source code Synchronizing customers in the CustDB sample