Leaving "Holes" in a Table

Charles Yeomans yeomans at desuetude.com
Wed Jul 16 16:53:34 CDT 2003


On Wednesday, July 16, 2003, at 04:38 PM, Ken Ray wrote:

>> On Wednesday, July 16, 2003, at 02:18 PM, Ken Ray wrote:
>>
>>> When I delete record ID 507 from a table of 1000 records,
>> and then add
>>> a new
>>> record to the table, it gets #507, not #1001 as I would expect. Is
>>> there any
>>> way to make this happen where #507 remains a "hole", and a
>> new record
>>> #1000
>>> is added?
>>
>> You can do this yourself. Add a VBoolean field IsDeleted, and simply
>> set the flag to mark records as deleted (also deleting VBlob
>> fields to
>> free up that space).
>
> Thanks, but I already have a boolean "DeleteFlag" field; the problem is
> that this flag is intended to allow the system administrator to remove
> records marked for deletion this way from the database. Normally this
> wouldn't be an issue, but I have in my interface that ability to "link"
> one person to another through a join table which holds the RecID of 
> each
> person. If person "A" (RecID: 100) is joined to person "B" (RecID: 
> 200),
> and then someone marks person "B" for deletion, the sysAdmin actually
> deletes the person, and then a new record is created, it takes up RecID
> #200 and my join is messed up.

This is what the DeletionControl parameter in VObjectPtr is for; if you 
set it to kV_SetNull, then the link to person "A" is zeroed out when 
person "B" is deleted.

Charles Yeomans



More information about the Valentina mailing list