>I have a database in a pricing app. SET DELETED is ON. There are various child records in three related files to the the primary key file in file Primex. When a record is deleted in file Primex and then a subsequent APPEND BLANK is used to append a new record I get the message 'Uniqueness of index file is violated'...how should I handle this ? Packing is a problem in the shared multiuser environment.
>Appreciate any help...Thanks,
As you've found, even DELETEd records count as far as PK uniqueness is concerned. If you're using APPEND BLANK, a blank PK value is created. If there is already one in the table you get the error.
If you know what your new PK value is going to be you can use INSERT - SQL instead (INSERT INTO ...) which puts the correct PK value in directly, avoiding a blank entry.
Depending on how you're managing your keys you might want to change the PK value of any record you delete to one which won't interfere with new PK generation. For example, for integer PKs you could make the values negative, or renumber them counting down from 2 billion.
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up