Previous Topic: ROLLBACKNext Topic: Logical Record Facility Commands


STORE

Purpose

Adds records to the database.

Syntax

►►─────── STORE record-name ───┬────────────────────┬─── . ───────────────────►◄
                               └─ error-expression ─┘

Parameters

record-name

Specifies the name of the object record occurrence to be moved from the dialog's record buffer to the database.

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

error-expression

Specifies the status codes that are returned to the dialog.

Usage

Definition

The STORE command moves the object record occurrence from the dialog's record buffer to the database and connects it to an occurrence of each set for which the record is defined as an automatic member. The STORE command performs the following functions:

Considerations

If autostatus is not in use, a dialog's error-status field indicates the outcome of a STORE command:

Status code

Meaning

0000

The request was executed successfully

1202

The suggested DIRECT-DBKEY value is not within the page range for the object record

1205

Storage of the record violates a duplicates-not-allowed specification for a CALC record, sorted set, or index set

1208

The object record is not in the dialog's subschema

1209

The object record's area was not readied in an update usage mode

1210

The dialog's subschema specifies an access restriction that prohibits storage of the named record

1211

The object record cannot be stored because of insufficient space

1212

The record cannot be stored because no database key is available

1221

An area other than the area of the object record was readied with an incorrect usage mode

1225

A current of set was not established for each set to which the object record is to be connected

1229

A run-unit deadlock condition occurred. DBMS aborted and rolled back the run unit. All resources associated with the task are released.

1233

Not all sets in which the object record participates as an automatic member are included in the dialog's subschema.

1255

An invalid length was defined for a variable-length record.

1261

The record cannot be stored because of broken chains in the database.

1287

The owner and member records for a set to be updated are not in the same page group or do not have the same dbkey radix point.

Further considerations

Example

The statements in the following example store a new ITEM record in the database and connect it to the correct occurrences of the ORDER-ITEM and PRODUCT-ITEM sets:

MOVE IN-PROD-NUMBER TO PROD-NUMBER.
FIND CALC PRODUCT.
MOVE IN-ORD-NUMBER TO ORD-NUMBER.
FIND CALC ORDOR.
STORE ITEM.

More information:

Error Handling

READY