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 youI 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...