Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ignoring deleted records in a SEEK
Message
From
14/03/2000 18:55:20
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00345465
Message ID:
00345621
Views:
17
SET DELETED Command

Specifies whether Visual FoxPro processes records marked for deletion and whether they are available for use in other commands.

Syntax

SET DELETED ON | OFF

Arguments

ON

Specifies that commands which operate on records (including records in related tables) using a scope ignore records marked for deletion.

OFF

(Default) Specifies that records marked for deletion can be accessed by commands that operate on records (including records in related tables) using a scope.

Remarks

Queries that use DELETED( ) to test the status of records can be optimized using Rushmore technology if the table is indexed on DELETED( ).

Important SET DELETED is ignored if the default scope for the command is the current record or you include a scope of a single record. INDEX and REINDEX always ignore SET DELETED and index all records in the table.

SET DELETED is scoped to the current data session.

In other words, a SEEK is only scoped to a single record and is not affected by the setting of SET DELETED.

HTH,

Jack

>Greetings all!
>
>Here's a fun little problem I just ran upon. My program is setup to look up a serial number specified by the user and see if it's in the database. In my code one of the first things I've done is "SET DELETED ON" so that deleted records are SUPPOSED to be ignored. Here's the fun part:) Over time alot of new records have been added, and deleted. Well now we're at the point where 2 records have the same serial #, however, one record is deleted, the other is not and is correct and up-to-date. So when I do a SEEK on the serial #s, shouldn't it ignore the deleted record and find the good one? Currently, the good record is below(in the index) the deleted record, and I guess that's why the SEEK returns EOF with no records found....is this right? Any thoughts? Please reply if you need further clarification on this. Thanks in advance for any help you can give:)
>
>John
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform