Previous Topic: FIND/OBTAIN DB-KEYNext Topic: FIND/OBTAIN WITHIN SET/AREA


FIND/OBTAIN OWNER

Purpose

Accesses the owner record of the current occurrence of a set.

Syntax

►►──┬─ FIND ───┬───┬──────────────────────────┬───────────────────────────────►
    └─ OBTAIN ─┘   └─ KEEP ───┬─────────────┬─┘
                              └─ EXCLUSIVE ─┘

 ►──── OWNER WITHIN set-name ───┬────────────────────┬─── . ──────────────────►◄
                                └─ error-expression ─┘

Parameters

KEEP

Places a shared lock on the object record.

EXCLUSIVE

Places an exclusive lock on the object record.

OWNER WITHIN set-name

Specifies the set whose owner record is to be retrieved.

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

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 FIND/OBTAIN OWNER command:

Status code

Meaning

0000

The request was executed successfully

0306

Currency was not established for the named record, set, or area

0308

The object record is not in the dialog's subschema

0310

The dialog's subschema specifies an access restriction that prohibits retrieval of the object record

0329

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 illustrate the use of the FIND/OBTAIN OWNER command:

MOVE 'CC' TO ORD-NUM.
OBTAIN CALC ORDOR.
OBTAIN LAST ITEM WITHIN ORDER-ITEM.
OBTAIN OWNER WITHIN PRODUCT-ITEM.

More information:

Error Handling

Conditional Commands