Previous Topic: CONNECTNext Topic: ERASE


DISCONNECT

Purpose

Disconnects a record occurrence from a set occurrence in which it participates as a member.

Membership in the object set must be defined as OPTIONAL in the dialog's schema.

Syntax

►►─── DISCONNECT record-name FROM set-name ───┬────────────────────┬──── . ───►◄
                                              └─ error-expression ─┘

Parameters

record-name

Specifies the current occurrence of the named record to be disconnected.

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

FROM set-name

Specifies the set from which the current occurrence of the named record is to be disconnected.

Set-name must be known to the dialog's subschema and must be defined as optional.

error-expression

Specifies the status codes that are returned to the dialog.

Usage

Considerations

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

Status code

Meaning

0000

The request was executed successfully

1106

Currency was not established for the object record

1108

The specified record is not in the dialog's subschema

1109

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

1110

The dialog's subschema specifies an access restriction that prohibits disconnecting the object record from the named set

1115

The DISCONNECT command cannot be executed because the object set is defined as mandatory

1121

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

1122

The object record is not currently a member of the specified set

1129

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

Further Considerations

Example

The statements in the following example establish an ITEM record as current of record type and disconnect the record from the PRODUCT-ITEM set:

MOVE 'P8' TO PROD-NUMBER.
FIND CALC PRODUCT.
FIND FIRST ITEM WITHIN PRODUCT-ITEM.
DISCONNECT ITEM FROM PRODUCT-ITEM.

More information:

Error Handling

CONNECT

READY