Previous Topic: Comparison ExpressionNext Topic: MODIFY


ERASE

Purpose

Deletes record occurrences.

The execution of an ERASE command does not necessarily result in the deletion of all or any of the database records used to create the object Logical Record Facility database-access record. The path selected to service the ERASE request performs only the database-access operations specified in the subschema.

Syntax

►►─── ERASE lr-name ────┬───────────────────────────────────┬─────────────────►
                        └─ WHERE lr-conditional-expression ─┘

 ►──┬────────────────────┬───── . ────────────────────────────────────────────►◄
    └─ error-expression ─┘

Parameters

lr-name

Specifies occurrences of the logical record used for database access.

Lr-name must be known to the dialog's subschema.

WHERE lr-conditional-expression

Specifies the selection criteria to be applied to the logical record request.

Syntax for lr-conditional-expression is described earlier in this section.

error-expression

Specifies the status codes that are returned to the dialog.

Example

The ERASE command in the following example deletes the occurrence of CUST-ORDER-LR with the specified customer and order numbers:

ERASE CUST-ORDER-LR
  WHERE CUST-NUMBER EQ '1234567890'
  AND ORD-NUMBER EQ '7654321'
  AND DELETE-ORDER.

The DBA-designated keyword, DELETE-ORDER, directs processing to a path that retrieves the applicable occurrence of the CUST-ORDER-LR logical record and deletes the specified order information from the database.

More information:

Error Handling