CDO$HELP.HLB  —  CDO Commands, CHANGE  RECORD Command
    Format

      CHANGE  RECORD  record-name

              [ DESCRIPTION IS /*text*/ ]
              [ NODESCRIPTION           ]  [AUDIT IS /*text*/]
              [                         ]

              [ constraint-clause             ]
              [ DELETE CONSTRAINT constr-name ]
              [ record-property               ] ... .
              [                               ]
              [ NOrecord-property             ]

              [ DELETE name . ] ...

              [ included-name-change-clause ]
              [ local-field-clause          ]
              [ record-change-clause        ] ...
              [ structure-change-clause     ]
              [                             ]
              [ variants-change-clause      ]

              END  [ record-name ]  RECORD .

1  –  Parameters

1.1  –  record-name

    Specifies the record element you are modifying.

1.2  –  text

    Modifies information. Within the DESCRIPTION clause, this is
    information documenting the record; within the AUDIT clause, it
    is a history list entry. Valid delimiters are /* */ or double
    quotation marks (" ").

    You can use Japanese to document comments in the DESCRIPTION or
    AUDIT clause for a field. To do this, use the SET CHARACTER_SET
    command, and set the character_set of the session to DEC_KANJI.

1.3  –  constraint-clause

    Adds a condition, known as a constraint, that affects adding or
    modifying data in a database table (record). Supported constraint
    types are NOT NULL, PRIMARY KEY, FOREIGN KEY, UNIQUE, and CHECK.

    Each constraint can be named and supplied with evaluation
    attributes DEFERRABLE or NOT DEFERRABLE. The default evaluation
    time for constraints in CDO is NOT DEFERRABLE (the constraint
    is evaluated at statement time). For more information, see the
    DEFINE RECORD_Constraint command.

1.4  –  constr-name

    Specifies the name of a constraint.

1.5  –  record-property

    Changes the value of an existing property or adds a new property
    in record, structure, variants, and variant definitions within
    a record element. You specify removal with the NO keyword. See
    rec-properties for the record properties CDO provides.

1.6  –  name

    Specifies the name of a record, structure, or field that you want
    to delete from the record.

1.7  –  included-name-change-clause

    Allows you to change existing field and record definitions within
    record elements. For more information, see the CHANGE
    RECORD_Included_Name_Change command.

1.8  –  local-field-clause

    Specifies the definition of the locally defined field. For more
    information, see the DEFINE RECORD_Local_Field command.

1.9  –  record-change-clause

    Adds field, record, structure, variants, and variant definitions
    within an existing record definition. For more information, see
    the CHANGE RECORD_Record_Change command.

1.10  –  structure-change-clause

    Allows you to change a structure definition within a record
    element. For more information, see the CHANGE
    RECORD_Structure_Change command.

1.11  –  variants-change-clause

    Allows you to change a variant definition, which is a set of
    two or more definitions that map to the same portion of a record
    element. For more information, see the CHANGE
    RECORD_Variants_Change command.

2  –  Description

    The CHANGE RECORD command modifies a record element by performing
    a change in place. CDO changes the values you specify, and other
    values remain the same.

    If a record element is controlled, CDO freezes previous versions
    and allows you to modify only the highest visible version. If a
    record element is uncontrolled, CDO modifies the highest version
    unless you specify another version number.

    If a record element is controlled, you must reserve the record
    element before you can issue the CHANGE RECORD command. The
    SHOW RECORD or SHOW RESERVATIONS command indicates whether this
    condition exists.

    When you change a record element that an Oracle Rdb database
    uses, you may need to integrate the database with the repository.
    CDO automatically sends a notice with the name of the database
    when this possibility occurs.

    To remove a field, record, or structure definition from a record
    element, if the definition is not contained within a variant or
    structure definition, specify the DELETE keyword, followed by
    the appropriate name or clause for the type of definition you are
    removing.

    To remove a definition from within a variant definition, use the
    NOVARIANTS and VARIANT keyword, followed by the DELETE clause.

    To remove a definition from within a structure definition,
    specify the CHANGE RECORD Structure Change Clause. Specify the
    DELETE keyword, followed by the name of the definition you are
    removing.

    If you are deleting a constraint, you must delete the
    constraint before you delete the field; they cannot be deleted
    simultaneously using the CHANGE RECORD command. To update
    the change in the database, you must integrate each change
    separately.

3  –  Examples

    1.CDO> CHANGE RECORD SUPPLIER_REC
      cont> ROW_MAJOR ARRAY 1:20.
      cont> END RECORD.

      This example uses the CHANGE RECORD command to add an array
      clause to a record called SUPPLIER_REC.

    2.CDO> CHANGE RECORD EMPLOYEE_WORK_SCHEDULE
      cont> NONAME COBOL.
      cont> END RECORD.

      In this example, the CHANGE RECORD command uses the NO keyword
      to remove the NAME FOR COBOL record property from the EMPLOYEE_
      WORK_SCHEDULE record definition.

    3.CDO> CHANGE RECORD EMP_ADDRESS.
      cont> DELETE DEPT_CODE.
      cont> END RECORD.

      In this example, the CHANGE RECORD command deletes the DEPT_
      CODE field definition.

    4.CDO> CHANGE RECORD EMP_ADDRESS.
      cont> DEFINE EMP_NAME.
      cont> END EMP_NAME DEFINE.
      cont> END RECORD.

      In this example, the CHANGE RECORD command adds the EMP_NAME
      record definition to the EMP_ADDRESS record element.

    5.CDO> CHANGE RECORD EMPLOYEE_REC
      cont> /* Adding new fields WAGE_STATUS and CLASS_CODE */.
      cont> DEFINE WAGE_STATUS.
      cont> END DEFINE.
      cont> DEFINE CLASS_CODE.
      cont> END DEFINE.
      cont> END EMPLOYEE-REC RECORD.

      To include an additional field in a record definition, use the
      CHANGE command with the DEFINE record property. The included
      field becomes the last field in the record definition. This
      example adds the fields WAGE_STATUS and CLASS_CODE to the
      record definition EMPLOYEE_REC.
Close Help