TurboIMAGE/XL Database Management System Reference Manual MPE/iX V6.5 (30391-90011)
Chapter 6 257
Host Language Access
ORDERS Database Model Program
Deleting an Entry
(USER SELECTS 8 TO DELETE AN ENTRY)
ROUTINE: Delete_A_Product
* OBJECTIVE: This routine deletes an entry from the Product master
* data set. The entry is specified by its key item value.
* Identifying the entry and deleting it are preceded by
* calls to DBLOCK and DBBEGIN to obtain locks and to start
* a new transaction.
*
* When the entry is located, the deletion of the record
* at the current record pointer is done by a call to
* DBDELETE.
*
* The completion of a transaction is achieved by a call
* to DBEND, and outstanding locks on this data set are
* released by a call to DBUNLOCK.
*
* ACCESS: Mode 1 - Shared Modify Access
*
* CALLED BY: Main Line
*
* CALLS: DBLOCK in mode 3 (unconditional)
* DBBEGIN in mode 1 (transaction begin)
* DBGET in mode 7 (calculated read)
* DBDELETE in mode 1 (delete)
* DBEND in mode 1 (transaction end)
* DBUNLOCK in mode 1 (unlock)
BEGIN ROUTINE
Product_Buffer is made up of:
Stock#
Description
CALL DBLOCK (DBname, Product_Master, Mode3_Unconditional, Status)
ERROR CHECKING
OBTAIN List ← "
@
;"
OBTAIN Text ← "Delete entry from Product set Begin "
OBTAIN Textlen ← 18
OBTAIN Key_Item_Value ← "STK30040"
CALL DBBEGIN (DBname, Text, Mode1_Xbegin, Status, Textlen)
ERROR CHECKING
CALL DBGET (DBname, Product_Master, Mode7_Calculated, Status, List,
Product_Buffer, Key_Item_Value)
ERROR CHECKING
CALL DBDELETE (DBname, Product_Master, Mode1_Delete, Status)
ERROR CHECKING
OBTAIN Text ← "Delete entry from Product set End "
OBTAIN Textlen ← 18
CALL DBEND (DBname, Text, Mode1_Xend, Status, Textlen)
ERROR CHECKING
CALL DBUNLOCK (DBname, Product_Master, Mode1_Unlock, Status)