DTRHELP.HLB  —  Commands Statements Clauses, DECLARE DOMAIN Command
       Creates the temporary definition of a DATATRIEVE domain.

       The following sections explain how to declare 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 declare a CDD$DATABASE domain, use the following syntax:

         DECLARE DOMAIN  domain-name  [USING]  database-name

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

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

         DECLARE DOMAIN  domain-name  [USING]  record-name

             [OF]  [DATABASE]  database-path-name

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

         To declare a network domain, use the following syntax:

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

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

             [[WITH] RELATIONSHIPS] ;

         To declare a relational domain, use the following syntax:

         DECLARE DOMAIN  domain-name [USING] relation-name

             [OF]  [DATABASE]  database-path-name

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

             [[WITH] RELATIONSHIPS] ;

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

         DECLARE DOMAIN  domain-name [USING] record-path-name ON
 file-spec

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

             [[WITH]  RELATIONSHIPS] ;

       To declare a view domain, use the following syntax:

       DECLARE DOMAIN view-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 name of the domain you are declaring.
       It must be a simple 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.
       It is a dictionary pathname.

    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.
       It is a dictionary pathname.

    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:

          node-name"username password [account-name]")

          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.

          node-name"*.username-prompt *.password-prompt [*.account-prompt]"

          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.

          node-name

          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.

    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 the permanent or temporary
       definition of this record (with the DEFINE RECORD or the DECLARE
       RECORD commands) before you can ready the domain.

    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-name

       Is the name of the view being defined.
       It must be a simple 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.

    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 path name of a record used to send and receive data
       with DECforms.

    RELATIONSHIPS

       It is ignored except in the declaration of a CDD$DATABASE
       domain where it is required to specify the characteristics
       of the related object.

    ; (semicolon)
       Ends the domain definition.

2  –  Examples

       Declare the DATATRIEVE domain D0 as pointing to the
       CDD$DATABASE database D_CDD$DATABASE.

       DTR> DECLARE DOMAIN D0 USING D_CDD$DATABASE WITH RELATIONSHIPS ;

       Declare the Oracle CODASYL DBMS domain D2. The name of the
       record-type is VENDOR, and the name of the database instance is
       CDD$TOP.DTR$LIB.DEMO.DBMS.PARTS_DB.
       The domain definition includes the FORM clause.

       DTR> DECLARE DOMAIN D2
       DFN>     USING VENDOR OF DATABASE CDD$TOP.DTR$LIB.DEMO.DBMS.PARTS_DB
       DFN>     FORM IS EMPFOR IN FORMS:PARTS.FLB;
       DTR>

       Declare a network domain called REMOTE_YACHTS:

       DTR> DECLARE 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 declares a DEC DATATRIEVE domain that
       automatically uses a form. The domain is declared for the relation
       EMPLOYEES.

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

       Declare 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> DECLARE DOMAIN PHONES USING
       DFN> CDD$TOP.DEPARTMENT.PHONE_REC ON PHONE.DAT;
       DTR>

       Declare a view of yacht and owner information:

       DTR> DECLARE 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