DTRHELP.HLB  —  Commands Statements Clauses, DEFINE TABLE Command
       Enters the definition of a dictionary or domain table in the data
       dictionary (Oracle CDD/Repository) and creates an access control
       list (ACL) for the table. The following sections explain how to
       define dictionary and domain tables.

       Format

         To define a dictionary table use the following syntax:

         DEFINE TABLE path-name

          [QUERY_HEADER [IS] "header-segment"[/...]]

          [EDIT_STRING [IS] edit-string]

          [USING] code-field : translation-field [,]
          {"code-1"  }  { "translation-1" }
          {code-1    }: { translation-1   }[,]
          {          }  {                 }

          [ {"code-2"  }  {"translation-2"  } ]
          [ {code-2    }: {translation-2    } ][,]
          [ {          }  {                 } ]

           .                .
           .                .
           .                .

          [     { "translation-n"  } ]
          [ ELSE {translation-n    } ]
          [     {                  } ]

         END_TABLE

         To define a domain table use the following syntax:

         DEFINE TABLE  path-name FROM [DOMAIN] domain-name

          [QUERY_HEADER [IS] "header-segment"[/...]]

          [EDIT_STRING [IS] edit-string]

          [USING] code-field : translation-field [,]
          [     { "translation-string"  } ]
          [ ELSE {translation-string    } ]
          [     {                       } ]

         END_TABLE

1  –  Arguments

    path-name

       Is the given name, full dictionary path name, or relative
       dictionary path name of the dictionary table being defined. The
       full dictionary path name of the table cannot resolve to the full
       dictionary path name of any other object or directory in the data
       dictionary system. The DEFINE TABLE command accepts both DMU or
       CDO style path names.

    "code" : "translation"

       Is a code-and-translation pair. You must separate each pair with
       a colon. The comma after each pair is optional. If the code or
       translation conforms to the rules for DEC DATATRIEVE names given
       in the DEC DATATRIEVE User's Guide, you do not have to enclose it
       in quotation marks. However, DEC DATATRIEVE converts to uppercase
       any lowercase letters in an unquoted code or translation.

       If the code or translation does not conform to the rules for DEC
       DATATRIEVE names (especially if it contains any spaces), or if
       you want to preserve lowercase letters, you must enclose the code
       or translation in quotation marks (" ") and follow the rules for
       character string literals.

    ELSE "translation"

       Is the translation to be used if you specify a code not
       defined in the dictionary table. The rules for specifying
       this translation string are the same as those for codes and
       translations.

    END_TABLE

       Ends the dictionary table definition.

2  –  Examples

       The following example defines a table of department codes and
       specifies a query header for the translations of the table:

       DTR> DEFINE TABLE DEPT_TABLE
       DFN> QUERY_HEADER IS "Responsible"/"Department"
       DFN> CE : "Commercial Engineering"
       DFN> PE : "Plant Engineering"
       DFN> CS : "Customer Support"
       DFN> RD : "Research and Development"
       DFN> SD : "Sales Department"
       DFN> ELSE "UNKNOWN DEPARTMENT"
       DFN> END_TABLE
       DTR>

       The following example defines a table with a translation for each
       possible rig and includes an edit string in the definition that
       displays the translation in a 10 character wide column:

       DTR> DEFINE TABLE RIGGING
       DFN> EDIT_STRING IS T(10)
       DFN> QUERY_HEADER "TYPE OF"/"RIGGING"
       DFN> SLOOP : "ONE MAST"
       DFN> KETCH : "TWO MASTS, BIG ONE IN FRONT"
       DFN> YAWL  : "SIMILAR TO KETCH"
       DFN> MS    : "SAILS AND A BIG MOTOR"
       DFN> ELSE    "SOMETHING ELSE"
       DFN> END_TABLE
       DTR> PRINT "KETCH" VIA RIGGING

        TYPE OF
        RIGGING

       TWO MASTS,
       BIG ONE IN
       FRONT

       DTR>

       The following example shows how to define a domain table that
       returns the price of a yacht when you enter a value for LENGTH_
       OVER_ALL. The example specifies a query header and an edit string
       for the translation field:

       DTR> DEFINE TABLE LOA_PRICE_TABLE
       DFN>     FROM YACHTS
       DFN>     QUERY_HEADER IS "SAMPLE"/"PRICE"
       DFN>     EDIT_STRING IS $$$,$$$
       DFN>     USING LOA : PRICE
       DFN>     ELSE "NO BOATS IN STOCK WITH THAT LOA."
       DFN> END_TABLE
       DTR> PRINT 26 VIA LOA_PRICE_TABLE

       SAMPLE
       PRICE

       $17,900

       DTR>
Close Help