Federico,
note that in VFP a deleted record is not removed from the tabel (until you
pack or do some similar action)
thus the deleted keys still exists and can potentially be restored
you can either use surrogate keys , which is a name to keys that bare no
relation to the data ( most recomended IMHO)
another option is to recycle used keys - i.e. recall the deleted record and
overwrite the data
yet another option is to add a filter on the primary key - but IMHO this is
not a very good idea (kinda beats the whole idea primary keys if you ask me)
Arnon
>
>I don´t know whether I´m missing anything, but I´m beginning to think
that
>the CANDIDATE indexes (indices?) are about as useful as the old UNIQUE
>ones, at least if you work with SET DELETED ON.
>
>The following program should not (IMHO) produce an error, but it does:
>
> SET DELETED ON
> CREATE TABLE TRY (KEYFIELD N(3))
> INDEX ON KEYFIELD TAG KEYFIELD CANDIDATE
> INSERT INTO TRY VALUE (1)
> DELETE FOR KEYFIELD=1
> INSERT INTO TRY VALUE (1)
>
>What does this mean? For example, assume an user had (once) entered a
>record with a key value of 1, and later on he deleted it. If you list the
>table, the key 1 does not show up. If you try to SEEK it, it´s not there
>and FOUND() returns .F.; ok! But, after all that evidence, if you try to
>INSERT a new record with key 1, it fails!
>
>Am I missing anything, or is this just a VFP botch up? Opinions?
>
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only