Subject: | |
From: | |
Reply To: | |
Date: | Thu, 27 Apr 1995 09:05:45 MDT |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Donna Garverick writes:
>
> Given how long I've been on HP's, you'd think I'd know the answer to this...
> but anyhow. We've written a program to clean-up one of our databases.
> It's doing a serial read on a manual master set followed by a delete.
> My question is - if the delete works, what happens to the file pointer?
> One would think that it should be pointing to the next record in line
> but the performance of our program seems to be saying otherwise. It's
> taking several passes to get all the records removed. I should add
> that we're using an o-l-d (and I mean OLD) version of Image, so this
> may be something that was fixed a long time ago. - d
>
Donna,
You're experiencing the classic issue of "migrating secondaries".
Because some records hash to the same record number, a linked list of
secondaries is created starting with the first record added which hashes
to this same record. These secondaries are added to unused records
following record they hash to. When you delete a record from a master,
the first secondary in the linked list is migrated to the record you
just deleted.
What this means is that, when you delete a record from a master,
a new record may have moved into its position. The way to do a serial
delete on a master is to do a the DBDELETE, then do a DBGET mode 1 and if
you get a successfull status, do the DBDELETE again. Repeat this until the
DBGET mode 1 returns status 17 (no entry). Then do the DBGET mode 2 and
continue this way until the DBGET mode 2 returns status 11 (End of file).
There is actually an intelligent discussion of this under DBDELETE in the
TurboIMAGE/XL manual (or whatever it's called today).
Here's my psuedo code sample:
Pardon my GOTO's....
loop1:
DBGET mode 2
if image-status = 11 goto exit
loop2:
DBDELETE
DBGET mode 1
if image-status = 0 goto loop2
goto loop 1
exit:
Hope this helps!
Rich
--
______________________________________________________________________
________ Dynamic Information Systems Corp. |
\!DISC / Rich Trapp | My opinions are my own.
\ / OMNIDEX Product Manager - IMAGE/SQL | With any luck they're
\ / Phone : 303 444-4000 | correct ;-)
\/ E-mail: [log in to unmask] |
----------------------------------------------------------------------
|
|
|