Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Filter in View
Message
De
06/12/1998 19:19:42
 
 
À
05/12/1998 10:49:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00164430
Message ID:
00164602
Vues:
24
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform