HP3000-L Archives

October 1998, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Tom Renz <[log in to unmask]>
Reply To:
Date:
Tue, 6 Oct 1998 11:22:42 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (78 lines)
Jim,

Whenever I want to code for this type of update using CIUPDATE & DBUPDATE
or the traditional DBDELETE/DBPUT scenarios I will open the database a
second time.  The second database would be used to perform the updates
while the first database open is used to read up/down the chain.

For a typical update operation the code would look some what like the
following code with numbers indicating the 1st open and 2nd open as the
prefixes:

1:DBFIND
1:DBGET (chain read)
        2:DBGET (mode-4 using record # from 1:DBGET)
        2:DBLOCK
        2:DBUPDATE
        2:DBUNLOCK
Go back to 1:DBGET until end of chain is reached

IMAGE keeps track of your forward and backward pointers for each path so
when you go to read the next record in the chain in "1:DBGET" IMAGE will
advance to the next record in the chain even though the current record was
changed by "2:DBUPDATE".  When the end of chain is reached, for a safety
check, you can also go back and do another "1:DBFIND" and "1:DBGETs" for a
"just in case".   This will keep your logic simple yet separate from your
current processing loop and not need to worry about keeping track of where
you are.

Hope this works for you.

tom renz.

------------------------------------------------------------------------------

On Mon, 5 Oct 1998 at 15:47:59 you wrote:
>Date:    Mon, 5 Oct 1998 15:47:59 -0400
>From:    Therm-O-Link <[log in to unmask]>
>Subject: CIUPDATE and Image Chains
>
>Well, thanks to all those who responded to my last inquiry about enabling
>CIUPDATE via DBCONTROL, I am in the process of updating a program to >make
use of CIUPDATE.  But now, I have some different types of questions.
>
>If I am reading down a chain and updating the values for that chain's
>search item, what happens to the chain information?  For instance, this
>program does a chained read by a certain value, and replaces the value for
>that search item with zeroes.  Can I do:
>
>DBFIND
>DBGET (chain forward)
>DBUPDATE (with new value)
>Go back to DBGET until end of chain is reached
>
>Or will the program "lose its place" on the chain because of the changing
>search item values?  If so, then I suppose I will have to save the value of
>the next record on the chain and get that record by address, instead of by
>chained read, so the processing logic would look like this:
>
>DBFIND
>DBGET (chain forward)
>Save next record address
>DBUPDATE (with new value)
>DBGET (by direct record address)
>Go back to the "Save" until there is no next record.
>
>
>On a related note, if I am reading down chain A and changing values for
>chain B's search item, what happens to the chain information?  Can I do
>what I outlined above in the first logic example, or will I need to keep
>track of the chain information in the program, as in the second example?
>
>As always, any and all help is appreciated.
>
>Jim Phillips                            Manager of Information Systems
>E-Mail: [log in to unmask]      Therm-O-Link, Inc.
>Phone: (330) 527-2124                   P. O. Box 285
>  Fax: (330) 527-2123                   Garrettsville, Ohio  44231

ATOM RSS1 RSS2