HP 3000 Manuals

CREATE RELATIONSHIP [ HP SYSTEM DICTIONARY XL SDMAIN ] MPE/iX 5.0 Documentation


HP SYSTEM DICTIONARY XL SDMAIN

CREATE RELATIONSHIP 

Creates a new relationship.

Syntax 

     C[REATE] R[ELATIONSHIP] 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]
            [;A[TTRIBUTE-]L[IST]=([ attribute-name1=[attribute-value1]]
                                  [,attribute-name2=[attribute-value2]]
                                                  .
                                                  .
                                                  .
                                  [,attribute-nameN=[attribute-valueN]])]
            [;C[OMMON] = common-entity-name1 
                        ,common-entity-name2 
                       [,common-entity-name3]
                       [,common-entity-name4]
                       [,common-entity-name5]
                       [,common-entity-name6]]
                       .

Parameters 

entity-name(N)        Name of the entity that establishes a relationship.
                      You can specify up to six entity names.  The order
                      of the entities entered should correspond to the
                      order of the entity types in the relationship type.

entity-type-name(N)   Name of the entity type involved in the
                      relationship type.

relation-class-name   Name of the relationship class.

attribute-name(N)     Name of the attribute to be assigned a value.

attribute-value(N)    The value to be assigned to the attribute.  If the
                      attribute is a variable length attribute, you must
                      specify the value within quotes.  Also, if the
                      attribute is of type alias or character, and the
                      attribute value includes invalid characters (See
                      "User-Defined Names" in Chapter 3) or is greater
                      than 32 characters in length, you must specify the
                      value within quotes.

common-entity-        Name of the entity involved in the relationship in
name(N)               the common domain whose attributes are to be shared
                      by the local domain relationship being created.
                      This keyword is not allowed if the dictionary is
                      open in the common domain.  If you use this
                      parameter, the attribute list can contain only the
                      following attributes:

                      sensitivity   Specifies the access rights to the
                                    entity

                      relationship  The logical order of a child entity
                      position      (the second entity in the
                                    relationship) relative to all other
                                    child entities for the same parent
                                    entity of the same relationship type

                      If you specify attributes other than these in the
                      attribute list, then you must not use this
                      parameter.

Description 

System Dictionary automatically assigns values for the following
attributes:

     scope-owner
     date-created
     date-changed
     scope-changed

If you do not specify the attribute name or you specify the name, but do
not assign a value, the default value from the attribute's edit values is
used.  If the attribute does not have any edit values, then the System
Dictionary default value for the attribute's data type is used.

     alias     :  No alias is assigned
     boolean   :  false
     character :  ASCII blank
     floating  :  Floating point zero
     integer   :  Binary zero
     variable  :  No value is assigned

If the attribute is of type boolean, the only values allowed are true and
false (may be abbreviated T and F, respectively).

The valid values for the sensitivity attribute are:

private       Only the owner scope is allowed access to the relationship,
              unless it assigns access to other scopes by associating
              the relationship to the scope by means of the ADD
              SCOPE-RELATIONSHIP command.  This is the default.

read          Any scope with read capability may read the relationship.
              The owner scope may, in addition, assign modify access to
              other scopes by associating the relationship to the scope
              by means of the ADD SCOPE-RELATIONSHIP command.

modify        Any scope with read capability may read the relationship.
              Any scope with create capability may read and modify the
              relationship.

You should only specify the attribute sensitivity for the first version
of a relationship to be created.  If you do not specify sensitivity for
the first version of a relationship, it defaults to private.  If you
specify sensitivity for subsequent versions of a relationship, it is
ignored.  If the relationship is to be linked to a relationship in the
common domain, the sensitivity cannot be greater than the sensitivity of
the relationship in the common domain.

The relationship-position attribute is treated specially by the system.
The system uses this attribute as a sequencing number to order
relationships with the same parent entity (i.e.  to represent the order
of elements in a record).  Accordingly, two relationships of a type with
the same entity in the first position cannot have the same value for
relationship-position.  To avoid conflicts, if you omit either
relationship-position completely or do not specify a value, the system
assigns a relationship-position value to place the new relationship at
the end of the current list.  That is, the system assigns a value greater
than the largest currently assigned to a relationship with the same
parent entity.  Note that this is different from other default values as
the default depends on the values assigned to other relationships and is
different for each relationship.

To link the relationship to a relationship in the common domain, the
current version must be linked to a version in the common domain.

If you assign the relationship an alias, the alias is associated with the
second entity in the relationship.  Only the second entity in the
relationship may have an alias, regardless of how many entities form the
relationship.  Therefore, relationship aliases are typically useful only
with binary relationships.

Open Mode:       Shared-update or exclusive-update

Scope:           DA scope or any scope with create capability.  The scope
                 with which the dictionary is open is the owner of the
                 relationship.

Example 

The following example creates a new relationship ORDERS contains CUSTOMER
of relationship type IMAGE-DATABASE contains IMAGE-DATASET. It is linked
to the relationship SALES contains SHIP-TO (of the same type) in the
common domain.

     >CREATE RELATIONSHIP orders, customer; 
     >>RELATIONSHIP-TYPE = image-database,image-dataset; 
     >>RELATIONSHIP-CLASS = contains; 
     >>COMMON = sales, ship-to. 
     >


MPE/iX 5.0 Documentation