TurboIMAGE/XL Database Management System Reference Manual MPE/iX V6.5 (30391-90011)
Chapter 6 255
Host Language Access
ORDERS Database Model Program
OBTAIN Textlen ← 14
CALL DBEND (DBname, Text, Mode1_Xend, Status, Textlen)
ERROR CHECKING
CALL DBUNLOCK (DBname, Product_Master, Mode1_Unlock, Status)
ERROR CHECKING
END ROUTINE
Updating an Entry
(USER SELECTS 7 TO DO AN UPDATE)
ROUTINE: Update_A_Customer
* OBJECTIVE: This routine updates a customer record interactively.
* Updating is achieved by using the key item value to
* locate the proper entry. It then displays the contents
* to be updated.
*
* To perform the actual update, a TurboIMAGE/XL
* transaction is started. The entry is retrieved using
* a re-read mode, and an item level lock is obtained using
* the search value. A contents check of the new values
* is done against the old values. If the contents have
* changed, the user can choose to abort the process. Otherwise,
* the transaction proceeds and the update takes place.
*
* ACCESS: Mode 1 - Shared Modify Access
*
* CALLED BY: Main Line
*
* CALLS: DBGET in mode 7 (calculated)
* DBLOCK in mode 5 (unconditional)
* DBBEGIN in mode 1 (transaction begin)
* DBGET in mode 1 (re-read)
* DBUPDATE in mode 1 (update)
* DBEND in mode 1 (transaction end)
* DBUNLOCK in mode 1 (unlock)
BEGIN ROUTINE
Customer_Buffer,
Customer_Buffer_New, and
Customer_Buffer_Old are made up of:
Account
Last-Name
First-Name
Initial
Street-Address
City
State
Zip
Credit-Rating
Lock_Descriptor_Customer_Type is made up of:
Length_Of_Descriptor
Data_Set_Of_Descriptor
Data_Item_Of_Descriptor