Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
See the deleted records 2
Message
From
10/02/2011 05:58:57
 
 
To
10/02/2011 05:04:10
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01499560
Message ID:
01499564
Views:
43
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?
Previous
Reply
Map
View

Click here to load this message in the networking platform