CDO$HELP.HLB  —  CDO Commands, EXTRACT
    Format

               { FIELD  }
      EXTRACT  { RECORD }   element-name ,...    [ qualifier ]
               {        }

1  –  Parameters

1.1  –  element-name

    Specifies the field or record element that you want to display in
    the DEFINE command format or ANSI C language format. You can use
    wildcard characters in this parameter.

2  –  Qualifiers

2.1    /LANGUAGE

    Format options:

       /LANGUAGE=CC
       /LANGUAGE=CDO (default)

    Use the /LANGUAGE qualifier to generate data defintions in one
    of two formats; either the default DEFINE command format or
    the ANSI-standard syntax for the C programming language. Valid
    options are:

    o  CC

       Specifies that the EXTRACT command converts the record to
       ANSI C language syntax. Each record that is converted to ANSI-
       standard syntax will include a comment statement that lists
       the original Oracle CDD/Repository data type information for
       each field in the record. For example:

       char  field1;    /*Text*/

    o  CDO

       Specifies that the EXTRACT command displays one or more
       repository elements in the format of the DEFINE command. The
       CDO option is the default.

3  –  Description

    The EXTRACT command displays one or more repository elements in
    the specified format. You can choose the DEFINE command format
    or the ANSI-standard syntax for the C programming language. By
    displaying an element in the DEFINE command format, the EXTRACT
    command makes it easier for you to create new versions of an
    uncontrolled element. By displaying an element in the ANSI C
    programming language format, you can use the definition when
    building applications.

    You can capture the output of the EXTRACT command in a file by
    issuing the SET OUTPUT command as the preceding command. For
    the DEFINE command, edit and execute the command file with the
    @ command. For the ANSI C programming language format, edit the
    output file to remove the EXTRACT command and then include the
    file in an application.

    If a field has character set attributes, you can display them
    using the SHOW and EXTRACT commands; in addition, you can use
    the SHOW command to display size information of a field in both
    character-based size and octet-based size. See the description
    of SET CHARACTER_SET command and the DATATYPE_Field_Property help
    topic found under the fld-properties topic for more information.

4  –  Examples

    1.CDO> DEFINE RECORD FULL_NAME.
      cont> FIRST_NAME.
      cont> MIDDLE.
      cont> LAST_NAME.
      cont> END RECORD.
         .
         .
         .
      CDO> DEFINE RECORD HOME_ADDRESS.
      cont> STREET_ADDRESS.
      cont> CITY.
      cont> STATE.
      cont> POSTAL_CODE.
      cont> END RECORD.
         .
         .
         .
      CDO> DEFINE FIELD BADGE DATATYPE IS UNSIGNED LONGWORD SIZE IS 5 DIGITS.
      CDO> DEFINE RECORD EMPLOYEE_REC_ONE.
      cont> FULL_NAME.
      cont> HOME_ADDRESS.
      cont> BADGE.
      cont> END RECORD.

      This example shows the definition of records used in the
      following examples.

    2.CDO> EXTRACT RECORD EMPLOYEE_REC_ONE /LANGUAGE=CC

        struct employee_rec_one
        {
          struct   {
            char  first_name[20];     /* Text */
            char  middle;     /* Text */
            char  last_name[20];      /* Text */
          } full_name;
          struct   {
            char  street_address[30]; /* Text */
            char  city[20];   /* Text */
            char  state[2];   /* Text */
            unsigned long  postal_code;       /* Unsigned Longword */
          } home_address;
          unsigned long  badge;       /* Unsigned Longword */
        };

      This example shows the EXTRACT command specifying the
      /LANGUAGE=CC qualifier.

    3.CDO> EXTRACT RECORD EMPLOYEE_REC_ONE /LANGUAGE=CDO
      Define record CDDRTEST:[CDDR_TEST.userid.TEST_REP]MY_DIR.EMPLOYEE_REC_ONE
          .
          CDDRTEST:[CDDR_TEST.userid.TEST_REP]MY_DIR.FULL_NAME(1).
          CDDRTEST:[CDDR_TEST.userid.TEST_REP]MY_DIR.HOME_ADDRESS(1).
          CDDRTEST:[CDDR_TEST.userid.TEST_REP]MY_DIR.BADGE(1)
          .
      End record.

      This example shows the EXTRACT command specifying the default
      /LANGUAGE=CDO qualifier.
Close Help