Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get no records when trying to exclude deleted records
Message
 
To
10/04/2001 22:24:04
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00494168
Message ID:
00494376
Views:
27
>Thanks to all who responded. I did realize that SQL select did not honor DELETED(). Will look at seting of deleted.

Claude,

Your SQL DOES honor the reference to the DELETED() function. The problem is that your function call is not doing what you think it is.

SQL in VFP does some really fancy stuff behind the scenes. For one it opens the tables referenced in the query again with a different alias. This means that your DELETED("SomeAlias") is looking at an alias where the record pointer is NOT moving. Therefore if the current record in the "SomeAlias" alias is deleted you get no records, if the current record in that alias is not deleted you will get all records. However, the records you get in your result come from a different alias than the one your function is checking.

The way to accomplish what you want is exactly what others have suggested, SET DELETED ON. This command causes VFP to ignore all records in all alias' that are deleted.
Previous
Reply
Map
View

Click here to load this message in the networking platform