Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
See the deleted records 2
Message
De
10/02/2011 05:58:57
 
 
À
10/02/2011 05:04:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01499560
Message ID:
01499564
Vues:
44
Borislav gave you the answer. Personally I rarely delete records, instead I have a logical field called Reusable, with a matching binary index tag. Whenever I need to add a record, I always use something like this
select top 1 pk from mytable where reusable order by reusable into array laPk
if _tally>0 && A reusable record is found
update mytable set field1=myvalue1, field2=myvalue2, reusable=.F. where pk=laPk
else
insert into mytable (field1, field2, pk) values (mavalue1, mavalue2, generateGuid())
endif
My pk is always a guid, created by the generateGuid() function. Remember, a Primary key shall not be meaningful, but guaranteed to be unique, which is what guid stands for, Globally Uniqie IDentifier.

>(Reviving the topic from yesterday)
>How can I check a table if it has any deleted records?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform