E@DBFULLDELSUB

Name

The E@DBFULLDELSUB call has the following format:

DN@<Logical>(E@DBFULLDELSUB)

where <Logical> identifies the database file to use to perform the E@DBFULLDELSUB call.

Description

E@DBFULLDELSUB deletes all records in a subrange.

When this routine deletes a subrange of database records, it also deletes all index entries associated with that subrange of records and all related records according to the delete rules as set in the database file definition.

Delete Rule Description
Delete Ignored No deletion of related records.
Delete Restrict Related records must be deleted or moved first by the application.
Delete Cascades Delete all records in the related table described by the relation.

For more information on data deletion rules, see the Application Development Workbench Standards guide

Using the API in a Program

You must populate the delimiting D@ fields, the D#END# field, and E@DBSUBRNG before using E@DBFULLDELSUB.

Note: In recoverable database environments, E@DBFULLDELSUB cannot span more than one transaction state. Deleting a very large subrange of records in a single block creates a very large journal, or transaction, that may exceed a limit. If a subrange does not realistically fit in a single transaction, you must use a modify/delete loop, with specific attention paid to controlling the size of the logical transactions.

Input Values

Field Description
<Logical> You must specify the database index name that you want to create a record in.
Record retrieval variables (also known as D@ fields)

You must populate the index key fields used to locate the record before using this call.

Fill in only the D@ fields that define the appropriate range; leave empty those D@ fields that do not define the range.

D#START#<KeyFieldName>

D#END#<KeyFieldName>

Define the beginning and ending values of the last key by moving the appropriate values to the record retrieval fields named D#START#<KeyFieldName> (starting value) and D#END#<KeyFieldName> (ending value). This defines the range itself.
E@DBSUBRNG Move a number into E@DBSUBRNG in order to tell the interface which key is the last significant one defining the range. This number is equivalent to the position of the field in the index.

Programming Example

The following example shows the E@DBFULLDELSUB routine used to drop a subrange of records from the a file.

     CALLP     U@AUDITEND                          Audit End
     EVAL      D@CMPNY        = VHRSAWFRCMPNY           
     EVAL      D#END#CMPNY    = VHRSAWTHRCMPNY    
     EVAL      E@DBSUBRNG     = 1
     CALLP     DS@DBHRSAW1(E@DBFULLDELSUB)         
     CALLP     U@AUDITEND                          Audit End