Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there a way to remove records from a table?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00166081
Message ID:
00166256
Vues:
17
Isn't that supposed to be:

INDEX ON pk TAG pk FILTER = !DELETED()

?

Not sure if the syntax is right since I'm only seen it done visually, but that's the general idea.

-Michelle

>Yes and no...
>you can
>Index on deleted() tag isdelete
>
>This still won't break the unique key that may be your CUST_ID field... This still can not be duplicated, even if is marked for deletion. However lets say you have
>
>Record 1 Cust ID = 10
>Record 2 Cust ID = 11 (This one is deleted)
>Record 3 Cust ID = 12
>Record 4 Cust ID = 13
>Record 5 Cust ID = 14 (This one also is deleted)
>
>And a user wants to add a new customer... Look for the first deleted record and
>re-use it... (provided set delete is off so all deleted records are visible to the seek function
>
>
>if seek( .t., "customer", "isdelete" )  && value, alias, index tag used
>   */ Now we found it, lets UNDELETE it and re-use this ID
>   recall
>else
>   */ No more deleted records to recycle, you must add a new one
>   */ either append blank, or whatever function you need to assign
>   */ the next customer ID available...
>   append blank
>endif
>
>*/ Now, the customer table is ready to be used with the current record
>*/ that has been either recalled (undeleted) or append blank (no more deleted)
>
>
>>Did I understand you correctly? Can you add deleted() to your index? Say I have two records that both have the same cust_id, but one record is deleted. Could I have cust_id has my primary index, with somehow including the deleted()?
>>
>>Brenda
>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform