Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filter in View
Message
From
06/12/1998 19:19:42
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00164430
Message ID:
00164602
Views:
20
>Make certain to SET DELETED OFF before the query to allow consideration of deleted records in the query result (and to be able to see tuples that contain deleted records in the result!)
>
>For deleted records:
>
> WHERE DELETED(cAliasName)
>
>undeleted records:
>
> WHERE NOT DELETED(cAliasName)
>
>Do not include any reference to DELETED() if both deleted and undeleted records are to be considered.

This is fine for a single table query, but I have found that I cannot rely on DELETED('alias') to evaluate the proper record in multi table selects.

For example, if I have two tables, customers and orders, to find all orders for deleted customers I tried

SELECT Order.*, Customer.Name;
WHERE Order.Custid = Customer.id;
AND DELETED('Customer')

this does not work. It seems that DELETED('Customer') is evaluated only once, and not for every record.

My suggestion, if you need fields from more than one table, but want to filter for deleted records in one table only, is to do it in two steps, and toggle SET DELETED() between the queries.
Erik Moore
Clientelligence
Previous
Reply
Map
View

Click here to load this message in the networking platform