TurboIMAGE/XL Database Management System Reference Manual (30391-90012)
Table Of Contents
- 1 Introduction
- 2 Database Structure and Protection
- 3 Defining a Database
- 4 Using the Database
- 5 TurboIMAGE/XL Library Procedures
- Using TurboIMAGE/XL Intrinsics
- DBBEGIN
- DBCLOSE
- DBCONTROL
- DBDELETE
- DBEND
- DBERROR
- DBEXPLAIN
- DBFIND
- DBGET
- DBINFO
- INTRINSIC NUMBER 402
- Syntax
- Parameters
- Discussion
- Mode 101: Item Number
- Mode 102: Item Name
- Mode 103: Items in Database
- Mode 104: Items in Data Set
- Mode 113: BTREEMODE1 and Wildcard Character
- Mode 201: Set Number
- Mode 202: Set Name
- Mode 203: Sets in Database
- Mode 204: Sets with Item
- Mode 205: Set Capacity
- Mode 206: Number of Data Set Chunks
- Mode 207: Size of Data Set Chunks
- Mode 208: Primary and Actual Capacity
- Mode 209: B-Tree Attachment
- Mode 301: Paths
- Mode 302: Key or Search Item
- Mode 401: Logging
- Mode 402: ILR
- Mode 403: Dynamic Roll-Back
- Mode 404: Logging Subsystem Information
- Mode 406: Database Information
- Mode 501: Subsystem Access
- Mode 502: Critical Item Update
- Modes 8nn: Third-Party Indexing
- Mode 901: Language
- DBLOCK
- DBMEMO
- DBOPEN
- DBPUT
- DBUNLOCK
- DBUPDATE
- DBXBEGIN
- DBXEND
- DBXUNDO
- 6 Host Language Access
- Model Program
- ORDERS Database Model Program
- Main Body of Program
- Opening the Database
- Retrieving All the Records on a Chain (with Item Level Locking)
- Retrieving a Data Entry Using a Record Number
- Retrieving Master Data Using a Key Value
- Retrieving Data Serially (with Set Level Locking)
- Adding an Entry
- Updating an Entry
- Deleting an Entry
- Rewinding a Data Set
- Obtaining Database Information
- Obtaining Error Messages and Explanations
- Closing the Database
- C
- COBOL II
- Defining Data Types, Variables, and Intrinsics
- Main Body of Program
- Opening the Database
- Retrieving All the Records on a Chain (with Item Level Locking)
- Retrieving a Data Entry Using a Record Number
- Retrieving Master Data Using a Key Value
- Retrieving Data Serially (with Set Level Locking)
- Adding an Entry
- Updating an Entry
- Deleting an Entry
- Rewinding a Data Set
- Obtaining Database Information
- Obtaining Error Messages and Explanations
- Closing the Database
- FORTRAN 77
- Pascal
- RPG
- 7 Logging and Recovery
- Database Utilities Used in Logging and Recovery
- Recovery Options
- Logical Transactions
- Dynamic Roll-Back Recovery
- Intrinsic Level Recovery
- Logging Preparation
- Step 1--Checking MPE/iX Logging Configuration
- Step 2--Acquiring Logging Capability
- Step 3--Logging to Tape or Disk
- Step 4--Building a Log File for Logging to Disk
- Step 5--Creating the Log Identifier
- Step 6--Setting the Log Identifier
- Step 7--Setting Flags for the Database Backup Copy
- Step 8--Making a Database Backup Copy
- TurboSTORE/iX 7x24 True-Online Backup
- Logging Status
- Logging Maintenance
- Roll-Forward Recovery
- Roll-Back Recovery
- DBRECOV Commands Used with Roll-Forward and Roll-Back Recovery
- Recovery Tables
- Post-Recovery Options
- The Mirror Database
- 8 Using the Database Utilities
- Restructuring the Database with TurboIMAGE/XL Utilities
- Summary of Utility Routines
- Utility Program Operation
- DBLOAD
- DBRECOV
- >CONTROL
- >EXIT
- >FILE
- >RECOVER
- >ROLLBACK
- >RUN
- DBRESTOR
- DBSTORE
- DBUNLOAD
- DBUTIL
- >>ACTIVATE
- >>ADDINDEX
- >>CREATE
- >>DEACTIVATE
- >>DETACH
- >>DISABLE
- >>DROPINDEX
- >>ENABLE
- >>ERASE
- >>EXIT
- >>HELP
- >>MOVE
- >>PURGE
- >>REBUILDINDEX
- >>REDO
- >>RELEASE
- >>SECURE
- >>SET
- >>SHOW
- Syntax
- Parameters
- Example (Show Users)
- Example Discussion
- Example (Show All)
- Example Discussion
- Example (Show Capacity)
- Format of Show Device List
- Example (Show Device)
- Format of Show Indices
- Example (Show Indices)
- Format of Show Locks List
- Example 1 (Show Locks)
- Example 1 Discussion
- Example 2 (Show Locks)
- Example 2 Discussion
- >>VERIFY
- 9 Using a Remote Database
- 10 Internal Structures and Techniques
- 11 B-Tree Indices
- A Error Messages
- B Results of Multiple Access
- C Database Design Considerations
- D Multiple Calls to DBLOCK
- E TurboIMAGE/XL Log Record Formats
- F MPE/iX Log Record Formats
- G Recovery and Logging Quick Reference
- H TurboIMAGE/XL versus TurboIMAGE/V

Chapter 4 115
Using the Database
Deleting Data Entries
Deleting Data Entries
Data is deleted from the database using the DBDELETE procedure. You can delete entries
from manual master and detail data sets. Entries are automatically deleted from
automatic master data sets as explained below.
To delete an entry from a data set, you must first locate the entry to be deleted by reading
it with the DBGET library procedure, or the DBFIND and DBGET procedures if it is
advantageous to use chained access to locate the entry. You then call the DBDELETE
procedure specifying the data set name. TurboIMAGE/XL verifies that your password and
associated user class number allow you to delete the current entry of the specified data set.
Sequence for Deleting Entries
If the detail data entry deleted is the only member of a detail chain linked to an automatic
master, and all other chains linked to the same automatic master entry are empty,
TurboIMAGE/XL automatically deletes the master entry.
If the data entry is in a manual master data set, TurboIMAGE/XL verifies that the detail
chains associated with the entry's search item, if any, are empty. If not, it returns an error
condition to the calling program. For example, if a program attempts to delete the
SUP-MASTER entry in Figure 4-2. that contains a SUPPLIER value of H&S SURPLUS,
an error condition is returned because a three-entry chain still exists in the INVENTORY
detail data set.
To delete the CUSTOMER data set entry with ACCOUNT equal to 75757575, the program
can call DBGET in calculated access mode specifying the CUSTOMER data set and the key
item value 75757575. If the procedure executes successfully, the program then can call
DBDELETE specifying the CUSTOMER data set to delete the current entry, provided no
chains in the related SALES detail data set contain search item values of 75757575.
Coordinating Deletions from a Database
A single DBDELETE call involves chain maintenance and other activity that can span
multiple data sets and multiple blocks within data sets even if an application is only
deleting entries from a single data set. TurboIMAGE/XL coordinates calls to DBDELETE to
ensure that one database user's DBDELETE activity does not interfere with calls made by
other users accessing the same database. Each DBDELETE request finishes processing
before TurboIMAGE/XL moves on to the next one. DBDELETE calls are serialized even if
they access unrelated data sets.
TurboIMAGE/XL provides a data prefetching option to enhance DBDELETE (and DBPUT)
processing. You can enable this option with the DBUTIL utility and are recommended to do
so only when all of the following conditions are true:
• Multiple processes are accessing the database.
• The processes are deleting data with the DBDELETE intrinsic (or adding data with the
DBPUT intrinsic).
• Adequate CPU and memory resources are available on your system.