Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 2 of 2 total |
Replication |
Tue, Apr 30 2019 2:44 PM | Permanent Link |
Greg Hallam Microcalm Solutions Inc | I have the following script preparing updates for replication. It is all working fine but I notice that I am sending a 900 byte file every minute that is essentially empty. How can I change my script to only send update files that have records and is this a good idea?
BEGIN DECLARE UpdateFile VARCHAR DEFAULT ''; USE "Office"; -- create the update file to send to the remote stores -- Assign main update file name SET UpdateFile = 'Office-' + REPLACE(':', '-', CAST(CURRENT_TIMESTAMP AS VARCHAR)); EXECUTE IMMEDIATE 'SAVE UPDATES FOR DATABASE "HBS Office" AS "' + UpdateFile + '" TO STORE "Office" TABLES Barcode, CashMaster, CashDetail, ProductInventory, SecDesc, UserAccess, Users, YardAddress'; -- Copy the main office update file to each store EXECUTE IMMEDIATE 'COPY FILE "' + UpdateFile + '.EDBUpd" IN STORE "Office" TO "' + UpdateFile + '.EDBUpd" IN STORE "Boston"'; EXECUTE IMMEDIATE 'DELETE FILE "' + UpdateFile + '.EDBUpd" FROM STORE "Office"'; END |
Tue, Apr 30 2019 3:51 PM | Permanent Link |
Terry Swiers | add ' IF NOT EMPTY' to the end of the save updates statement.
I would also suggest adding code to check to see if the file exists before you attempt to copy and delete it. |
This web page was last updated on Monday, April 29, 2024 at 05:23 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |