Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multi location Database Application
Message
From
02/10/2001 23:55:59
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00471633
Message ID:
00563421
Views:
18
Hi,
Thank you reply.
I am writing module for data replication. I am using the simplest method to get the changed record, that is, compare the current working tables' records with my backup tables' record. Each of the records of working table will be SCAN, and SEEK the same table from my backup. After that, all the changed records will be INSERTED to forwardtable.
After that, the forwardtables will be copied to main server (in specific directory). My udaterec() method will SCAN through all changed records and update my main database.


SELECT forwardtable
SCAN
SELECT mymaintable
SEEK EVAL(cprikey)
IF FOUND()
***UPDATE to maintable
ELSE
***INSERT INTO maintable
ENDIF
ENDSCAN


I have problem that, SEEK always locate to the 1st matched of records. It is because there are two duplicated record in the table. One of them is deleted and the other is not.
How could I SEEK to the correct record in this situation? BTW, some of the tables don't have primary key (I knwo it is bad design). I decided to define primary for each tables. However, I still got a problem of deleted record. Since we are using DELETE and INSERT while updating record, the primary key may need to have filter - NOT DELETED(). If so, the deleted records will not appear once I SET ORDER TO myprimary for SEEK. I need to detect the deleted status to delete/recall that records from main database.

Any ideas?

Thank you
I am not the most powerful man in this world.
I am not the worst man in this world either.
I just as same as all of you.
I still need to learn from my mistakes...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform