DTRHELP.HLB  —  Commands Statements Clauses, DEFINE DOMAIN Command
       Stores a domain definition in the Oracle CDD/Repository data
       dictionary system.

       The following sections explain how to define domains for
       CDD$DATABASE objects, Oracle CODASYL DBMS databases, network
       domains based on domains residing at other DECnet[TM] nodes,
       domains based on relational databases, domains based on single
       RMS files, and views based on one or more domains.

       Format

         To define a CDD$DATABASE domain, use the following syntax:

         DEFINE DOMAIN  domain-name  [USING]  database-name

             [FORM [IS] form-name [IN] file-name [USING exchange-rec]]

             [WITH]  RELATIONSHIPS ;

         To define a Oracle CODASYL DBMS domain, use the following
         syntax:

         DEFINE DOMAIN  domain-name  [USING]  record-name

             [OF]  [DATABASE]  database-path-name

             [FORM [IS] form-name [IN] file-name [USING exchange-rec]] ;

         To define a network domain, use the following syntax:

         DEFINE DOMAIN  domain-name [USING] remote-path-name AT
                        node-spec

             [FORM  [IS]  form-name  [IN] file-name [USING exchange-rec]]

             [[WITH] RELATIONSHIPS] ;

         To define a relational domain, use the following syntax:

         DEFINE DOMAIN  domain-name [USING] relation-name

             [OF]  [DATABASE]  database-path-name

             [FORM [IS] form-name [IN] file-name [USING exchange-rec]]

             [[WITH] RELATIONSHIPS] ;

         To define a domain based on a RMS file, use the following
         syntax:

         DEFINE DOMAIN  path-name [USING] record-name ON file-spec

             [FORM [IS] form-name [IN] file-name [USING exchange-rec]]

             [[WITH]  RELATIONSHIPS] ;

       To define a view domain, use the following syntax:

       DEFINE DOMAIN view-path-name OF domain-name-1 [,...][BY   ]
               [USING]

           level-number-1  field-name-1    OCCURS FOR rse-1.

           level-number-2  field-name-2  { OCCURS FOR rse-n        } .
             { FROM domain-name-n }

             .         .                   .
             .         .                   .
             .         .                   .

           [FORM [IS] form-name [IN] file-name [USING exchange-rec]]

           [[WITH] RELATIONSHIPS] ;

1  –  Arguments

    domain-name

       Is the Oracle CDD/Repository dictionary path name of the domain
       you are defining. The domain-name can be either a DMU or CDO
       style path name.

    database-name

       Is the name of a CDD$DATABASE object, defined through CDO using
       the DEFINE DATABASE command, that points to a CDD$RMS_DATABASE
       object. Refer to the Oracle CDD/Repository documentation for more
       information on CDD$RMS_DATABASE objects.

    record-name

       Is the name of a record type contained in a subschema of the
       specified Oracle CODASYL DBMS database.

    database-path-name

       Is the DEC DATATRIEVE definition of the database instance. The
       database-path-name can be both DMU and CDO style path name.

    remote-path-name

       Is the given name, full dictionary path name, or relative
       dictionary path name of a domain definition at another node
       in a network of computers linked by DECnet. That domain, the
       associated record definition, and the associated data file must
       already exist in the data dictionary at the remote node before
       you can ready the network domain. The domain-name can be either a
       DMU or CDO style path name.

    node-spec

       Specifies the network address.

       If the login procedure used by the remote process does not
       supply the necessary login information (user name, password,
       and, optionally, account name), either the person readying the
       network domain or the network domain definition must supply this
       information.

       You can use any of the following formats to specify the network
       address and to provide the best level of access security for your
       installation:

          Examples of this format are:

          BIGVAX"WARTON KNOCKKNOCK DEPT32"

          ELEVEN"LINTE LETMEIN"

          When you specify the network address using this format, users
          do not have to supply login information when readying the
          network domain.

          Examples of this format are:

          WINKEN"*.USERNAME *.PASSWORD *.ACCOUNT"

          VAXTWO"*.'user name' *.'password'"

          PDPTWO"*.'user name' *.'password'"

          When you specify the network address using this format, users
          are prompted for login information when they ready the network
          domain. This method provides the best security.

          Two examples of this format are:

          BIGVAX

          DEC:.zko.star

          Note that Poor Man's Routing is not accepted in AT clauses.

          When you specify the network address with this format,
          the account used by the remote process must provide login
          information automatically.

       If you prefer, you can combine elements from the first two
       formats. For example, you can explicitly specify the user name
       and specify a prompting value expression for the password:

       SNOOPY"CLARK *.PASSWORD"

    relation-name

       Is the name assigned to the relation when the database was
       created.

    path-name

       Is the given name, full dictionary path name, or relative
       dictionary path name of the domain being defined. The path name
       cannot resolve to the full dictionary path name of any other
       object or directory in the data dictionary system. The path-name
       can be either a DMU or CDO style path name.

    record-name

       Is the given name, full dictionary path name, or relative
       dictionary path name of the record definition to be associated
       with the domain. You must enter this record definition in the
       data dictionary (with the DEFINE RECORD command) before you can
       ready the domain. The dictionary path name of the record cannot
       resolve to the full dictionary path name of any other directory
       or object in the data dictionary. The record-name can be either a
       DMU or CDO style path name.

    file-spec

       Is the OpenVMS file specification of the RMS file containing
       the data for the domain. This file must exist when you ready the
       domain. A complete file specification has the following format:

       node-spec::device:[directory]file-name.type;version

    view-path-name

       Is the given name, full dictionary path name, or relative
       dictionary path name of the view being defined. The path name
       cannot resolve to the full dictionary path name of any other
       object or directory in the data dictionary. The view-path-name
       may be either a DMU or CDO style path name.

    domain-name-1

       Is either the given name, full dictionary path name, or relative
       dictionary path name of a domain containing records to be
       included in the view. If the domain name is a domain path name,
       it cannot duplicate the name of the view. When specifying more
       than one domain path name, use a comma to separate each name from
       the next. The domain-name may be either a DMU or CDO style path
       name.

    level-number

       Is the level number for a field in the view definition.

    field-name

       Is the name of a field in the view definition. If field-name is
       followed by an OCCURS FOR clause, field-name has no relationship
       to any field in the domain or domains specified in the RSE.
       Whether or not field-name is the same as the names of any of
       those fields does not matter. If field-name is followed by a
       FROM clause, field-name must be the name of a field in a domain
       specified in the OF domain-name-1 [,...] clause.

    OCCURS FOR rse

       Indicates that the associated field is to be included in the view
       only for those records specified by the RSE. The RSE must contain
       a reference to one of the domains, relations, or Oracle CODASYL
       DBMS records listed in the OF clause.

    FROM domain-name

       Indicates that the definition of the associated field is
       identical to that of the field of the same name in the domain,
       relation, or Oracle CODASYL DBMS record specified by domain-name-
       n. The argument domain-name must be the same as that used in the
       preceding OCCURS FOR clause.

    . (period)

       Ends a field definition.

    form-name

       Is a form name.

    file-name

       For VAX TDMS and DEC FMS[TM] forms it is the name of a form
       library. For DECforms[TM] forms it is the form file name,
       which can either be a .FORM or a .EXE file. A complete file
       specification has the following format:

       node-spec::device:[directory]file-name.type;version

    exchange-rec

       Is the Oracle CDD/Repository path name (either DMU or CDO) of a
       record used to send and receive data with DECforms.

    RELATIONSHIPS

       Causes relationships to be set up between the domain being
       defined and one of the following items:

       o  The CDD$DATABASE object

       o  The domain specified on the remote node

       o  The record definition

       o  The objects referenced by the view

    ; (semicolon)

       Ends the domain definition.

2  –  Examples

       Define the CDD$DATABASE domain NEWYACHTS. Use the already defined
       CDD$DATABASE YACHTS.

       DTR> DEFINE DOMAIN NEWYACHTS USING YACHTS_DB
       DFN> WITH RELATIONSHIPS;

       Define the Oracle CODASYL DBMS domain EMPLOYEES. The name of the
       record-type is EMPLOYEE, and the name of the database instance is
       PARTS_DB. The domain definition includes the FORM clause.

       DTR> DEFINE DOMAIN EMPLOYEES
       DFN>     USING EMPLOYEE OF DATABASE PARTS_DB
       DFN>     FORM IS EMPFOR IN FORMS:PARTS.FLB;
       DTR>

       Define a network domain called REMOTE_YACHTS:

       DTR> DEFINE DOMAIN REMOTE_YACHTS USING
       DFN>    CDD$TOP.DTR$LIB.DEMO.YACHTS AT
       DFN>    VAX32"SMITH ADRIENNE" FORM IS YACHT1 IN DTRFRM;
       DTR>

       The following example defines a DEC DATATRIEVE domain that
       automatically uses a form. The domain is defined for the relation
       EMPLOYEES.

       DTR> DEFINE DOMAIN EMPLOYEES
       DFN>     USING EMPLOYEES OF DATABASE PERSONNEL
       DFN>     FORM IS EMPFOR IN FORMSLIB;
       DTR>

       Define the domain PHONES. Use the record definition PHONE_REC
       that is cataloged in the directory CDD$TOP.DEPARTMENT. Specify
       PHONE.DAT as the data file:

       DTR> DEFINE DOMAIN PHONES USING
       DFN> CDD$TOP.DEPARTMENT.PHONE_REC ON PHONE.DAT;
       DTR>

       Define a view of yacht and owner information:

       DTR> SHOW BOAT_VIEW
       DOMAIN BOAT_VIEW OF YACHTS, OWNERS USING
       01 BOAT_INFO OCCURS FOR YACHTS.
          03 TYPE FROM YACHTS.
          03 SKIPPERS OCCURS FOR OWNERS WITH TYPE EQ BOAT.TYPE.
             05 NAME FROM OWNERS.
             05 BOAT_NAME FROM OWNERS.
       ;

       DTR> READY BOAT_VIEW
       DTR> PRINT FIRST 4 BOAT_VIEW

                                                BOAT
       MANUFACTURER   MODEL       NAME          NAME

        ALBERG      37 MK II
        ALBIN       79
        ALBIN       BALLAD
        ALBIN       VEGA       STEVE      DELIVERANCE
                               HUGH       IMPULSE

       DTR>

       You can use a view domain such as BOAT_VIEW as a source for
       modifying data in a domain based on a RMS file.
Close Help