Purpose
Retrieves logical record occurrences.
Syntax
►►───── OBTAIN ───┬─ FIRST ──┬─── lr-name ────────────────────────────────────► └─ NEXT ◄ ─┘ ►───┬───────────────────────────────────┬──────┬────────────────────┬── . ───►◄ └─ WHERE lr-conditional-expression ─┘ └─ error-expression ─┘
Parameters
Retrieves the first occurrence of the named logical record that meets the selection criteria specified in the WHERE clause.
Retrieves the next occurrence of the named logical record that meets the selection criteria specified in the WHERE clause.
NEXT is the default when neither FIRST or NEXT is specified.
If the same selection criteria were not specified in a previous OBTAIN command, OBTAIN NEXT is equivalent to OBTAIN FIRST.
Specifies the name of the logical record
Lr-name must be known to the dialog's subschema.
Specifies the selection criteria to be applied to the logical record request.
Syntax for lr-conditional-expression is described earlier in this section.
Specifies the status codes that are returned to the dialog.
Usage
Definition
Data from object logical-record fields is transferred to the buffer established in the dialog's record buffers. The OBTAIN command can be issued iteratively to retrieve a series of record occurrences that meet the criteria specified in a WHERE clause.
Example
The statements in the following example retrieve all occurrences of the logical record CUST-ORDER-LR for customer 1234567890:
OBTAIN FIRST CUST-ORDER-LR
WHERE CUST-NUMBER EQ '1234567890'.
ON LR-NOT-FOUND THEN INVOKE 'CUSTCHEK'.
ON LR-FOUND
REPEAT.
OBTAIN NEXT CUST-ORDER-LR
WHERE CUST-NUMBER EQ '1234567890'.
.
.
.
END.
DISPLAY.
|
Copyright © 2014 CA.
All rights reserved.
|
|