Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Uniqueness of Index problem - can't see how it could hap
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00689229
Message ID:
00689432
Vues:
26
>I am not referring to SET DELETED command. As you might know that when record is deleted from dbf, it not *physically* removed, it is marked as "Deleted". Unique Index doesn't consider this by default. So, you have specify "Filter" condition with that index. You can do this with Table Designer, Click on the Filter button for the unique index and put "!DELETED()" and see if it works.
>


Obviously the !DELETED() on the For clause (filter) will do the job. But can anyone tell me the logic in this necessity ?
How to deal with it in a case like CREATE CURSOR MyCursor (... UNIQUE) ?

Of course, I can understand that there might be some logic in preventing a table from adding a key which is known as deleted, hence subject to be ReCalled. However, this logic is too far away because of no other commands supporting this logic;
That SEEK won't find the deleted record, okay (note that that formally works on the result in the dbf), but that INDEXSEEK won't find it either ? IOW, VFP knows that the index record doesn't direct to a live record in the dbf, so the UNIQUE clause must be able to work it out like INDEXSEEK does. But it just doesn't.

Wouldn't the UNIQUE work like some rule ? IMO it does, and the help on INDEXSEEK tells that when the second parameter (lMovePointer) is (defaulted to) .F., rules and triggers won't fire; having this parameter at .T. will.
Well, in neither way it 'll come up with the record existing (SET DELETED = ON) and I am glad for that ...

Anyway, I'd say that the UNIQUE clause on for example the CREATE is fairly useless, unless you intend to never delete any keys subject to appending again.
Or I must be missing something.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform