Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multi location Database Application
Message
From
22/09/2001 13:15:17
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
21/09/2001 22:17:31
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00471633
Message ID:
00559671
Views:
18
>Hi,
> Thank you for your advise. I am starting to develop the module of replication. However, I face some problems here.
>
>My design:
>1. I store all tablenames in a table named tbltables. It has a field that specific the "role" of the particular table in replication. It is either send to server, send to client or both.
>
>2. Then, it also has some memo fields that will store the coding of each tables to execute some extra process before/after the replication done. For example, a after replication process for sales that will update member's points base on each member sales.
>
>3. My program will SCAN thorugh those tables recorded in tbltables and verify it's role. Then, compare each records with it's backup table (which will be copy to another folder after replication). Any new/updated records will be insert to another table in a folder called ForwardFolder.
>
>Hmm.. I think the design above should be fine.. (still under design and testing)... however, if I need to have filtering of the records before replication, how should I design it, expecially there are some master and child relatinship tables. For example, sales will have a child table called sdetails.

I've been doing some things like this. It wasn't replication of this sort, it was a transfer of finalized data from one module to another (with a different structure of data), but the general logic is similar. You seem to be on the right track.

>So, only records that belong to master sales table (which is valid for replication) should be copied. How to do this?

Well, in (2) you already have some code. Add more, or add a separate memo with more, which will check the parent table filtering, and thus decide whether to process the current child records or not. Just make sure that your tbltable is indexed so the parent tables come first.

>Do you think I should record the master table of each table (if any) in tbltables, then re-execute master table's filtering procedure again in order to get child records??

It may be as simple as to look for the replicated parent's key (which should be the foreign key in your child table) and see if it got replicated. If it didn't, skip the current set of records in the child. You can even do a
Scan for seek(child.fk, 'transferredparent','parentPK')
on the child table.
>Do you have any suggestion?
>
>Thank you in advance.
>Please don't hestitate to ask if any unclear matter.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform