Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Views will not show deleted records
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00924761
Message ID:
00924890
Vues:
12
David,

>Oddly, the view correctly displayed the filtered set of deleted records after I removed a related table used in the view. I'm assuming that FoxPro won't display a filtered set of the deleted records, because each deleted record is in a relationship with a non-deleted record from another table.

When you have a JOIN, the WHERE clause is actually filtering a temp cursor created from the JOIN (this is a simplification). Since the delete mark doesn't get passed to the temp join cursor, the check for DELETED() returns 0.

I'm not sure if it'll work, but you could try adding DELETED([alias]) as part of the JOIN condition (make sure you specify the alias). Another option might be to try a HAVING clause checking a field "DELETED([alias]) as lDeleted" or -- if this is a one-to-many join-- "sum(iif(DELETED([alias]),1,0)) as nDeleted"

If deleted needs to mean something more than "I don't ever want to know about this record again" than I would suggest adding a tDeleted T field and use that to indicate "Deleted" Easier if you plan that upfront, so you can include that in all of your view's WHERE, but it offers a lot more flexibility than the delete mark.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform