RESEQUENCE [ HP SYSTEM DICTIONARY XL SDMAIN ] MPE/iX 5.0 Documentation
HP SYSTEM DICTIONARY XL SDMAIN
RESEQUENCE
Resequences the relationships of a relationship type.
Syntax
RESE[QUENCE] entity-name1
,entity-name2
[,entity-name3]
[,entity-name4]
[,entity-name5]
[,entity-name6]
;R[ELATIONSHIP-]T[YPE] = entity-type-name1
,entity-type-name2
[,entity-type-name3]
[,entity-type-name4]
[,entity-type-name5]
[,entity-type-name6]
[;R[ELATIONSHIP-]C[LASS] = relation-class-name]
[;B[EFORE-]E[NTITY] = before-entity-name2
[,before-entity-name3]
[,before-entity-name4]
[,before-entity-name5]
[,before-entity-name6]]
.
Parameters
entity-name(N) Name of the entity involved in the relationship to
be resequenced.
entity-type-name(N) Name of the entity type involved in the
relationship type.
relation-class-name Name of the relationship class.
before-entity- Name of the child entity in the relationship that
name(N) the relationship to resequence is to be positioned
before. The parent entity in the relationships is
entity-name1. The entity you specify here must be
the child entity associated with the parent entity.
Therefore, the number of entities you specify in
the list must be one less than the number you
specified in the entity-name list in the object
clause. The numbers correspond to the 2nd, 3rd, ..
6the positions in the relationship. If you do not
specify this parameter, the relationship to
resequence is positioned as the last relationship
of the relationship type.
Description
The sequence in which the relationships are numbered, through the
relationship-position attribute, is the sequence the relationships are
reported when using the reporting commands if one or more entity
positions are specified without qualification.
When a relationship is resequenced, the relationship-position attribute
is modified to have a value between the BEFORE-ENTITY relationship and
the relationship preceding the BEFORE-ENTITY relationship.
For example, a Pascal program has the following data structure:
Employee = RECORD
Last-Name : PACKED ARRAY [1..20] OF CHAR;
First-Name : PACKED ARRAY [1..20] OF CHAR;
Empl-Num : INTEGER;
END;
To define the data structure, the following relationships of relationship
type RECORD contains ELEMENT exist in the dictionary: employee contains
last-name, employee contains first-name, and employee contains empl-num
with relationship-position values of 10, 20, and 30 respectively.
The program changes to have the following data structure:
Employee = RECORD
Empl-Num : INTEGER;
Last-Name : PACKED ARRAY [1..20] OF CHAR;
First-Name : PACKED ARRAY [1..20] OF CHAR;
END;
To redefine the data structure in the dictionary, you can resequence the
relationships by specifying employee contains empl-num as the
relationship to resequence and last-name as the BEFORE-ENTITY. This
assigns 5 as the relationship-position value of relationship employee
contains empl-num. The relationships now define the new structure.
If the new relationship-position coincides with an existing one,
a collision error occurs and you will either have to renumber
the relationships through the RENUMBER command, or modify the
relationship-position attribute value through the MODIFY RELATIONSHIP
command/subcommand pair.
Open Mode: Shared-update or exclusive-update
Scope: DA scope or a scope with create capability and modify
access to all relationships with the specified
entity-name1 as the parent entity
Example
The following example positions the relationship employee contains
empl-num of relationship type record contains element before the
relationship employee contains last-name.
>RESEQUENCE employee, empl-num;
>>RELATIONSHIP-TYPE = record, element;
>>RELATIONSHIP-CLASS = contains;
>>BEFORE-ENTITY = last-name.
>
MPE/iX 5.0 Documentation