Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Missing records and need to be inserted in tables
Message
 
À
23/06/2000 12:15:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00383837
Message ID:
00383912
Vues:
23
I'd just do it with brute force. Make sure you have the appropriate indexes set-up and while scanning through one file, check for the matching record in the other file and add the record if it isn't found. Then do the same while scanning through the other file. This is in my case. I have easy access to the server when nobody else is around so I would just start it up and wait for it to finish. It won't take that long. But maybe your case is different. I guess maybe some SQL command to grab the records that don't appear in both tables and then using that recordset to append to the appropriate tables might work faster, but if you can gain access to the server and run a utility program to fix the tables by brute force, why not? You can go back to your machine and do some work while it chugs away.

Take care,
Joe

>Hi All,
>
>I have one EMPLOYEE.DBF which contains many employee's ID number
>EMPLOYEE.DBF
>ONE FIELD:(5 CHAR)
>
>EMPNO (employee's id field)
>
>AAAAA
>BBBBB
>CCCCC
>DDDDD
>EEEEE
>FFFFF
>.......
>
>linked to the following tables also dbf extension on the same directory :
>AAAAA.DBF, BBBBB.DBF, CCCCC.DBF, DDDDD.DBF, EEEEE.DBF .....
>
>but in the AAAAA.dbf contains 2 fields :
>date code
>06/20/2000 AA (1 record)
>06/21/2000 AB (2 record)
>06/22/2000 AC (3 record)
>
>compare with another master table called ABSENCE.DBF with 3 fields
>
>empno date code
>AAAAA 06/20/2000 AA (1 record)
>AAAAA 06/22/2000 AC (2 record)
>AAAAA 06/23/2000 AD (3 record)
>
>How can I insert the (2 record) from AAAAA.DBF in ABSENCE.DBF and vice-versa the (3 record) from ABSENCE.DBF in AAAAA.DBF ,and actually
>the two tables should have the same number of records.
>
>The expected results should be :
>
>AAAAA.DBF
>
>date code
>06/20/2000 AA (1 record)
>06/21/2000 AB (2 record)
>06/22/2000 AC (3 record)
>06/23/2000 AD (4 record newly inserted)
>
>ABSENCE.DBF with 3 fields
>
>empno date code
>AAAAA 06/20/2000 AA (1 record)
>AAAAA 06/21/2000 AB (4 record newly inserted)
>AAAAA 06/22/2000 AC (2 record)
>AAAAA 06/23/2000 AD (3 record)
>
>I'm looking for the fast processing codes to do this because of millions records to be compared and inserted.
>
>Any code's suggestions would be really appreciated and thanks in avance.
>
>Paul
Joseph C. Kempel
Systems Analyst/Programmer
JNC
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform