Format { FIELD } CONSTRAIN { RECORD } [qualifier] ... element-name ,... { GENERIC type-name } { } [ DESCRIPTION IS /*text*/ ] [ AUDIT IS /*text*/ ]
1 – Parameters
1.1 – type-name
Specifies the type of the generic element you are constraining.
1.2 – element-name
Specifies the element you are constraining. You can substitute an asterisk (*) wildcard character for this parameter.
1.3 – text
Documents the element within the DESCRIPTION clause. Adds information to the history list entry within the AUDIT clause. 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.
2 – Qualifiers
2.1 /CLOSURE
Format options: /CLOSURE=TO_BOTTOM /NOCLOSURE (default) Specifies whether CDO constrains additional elements. Using the /CLOSURE=TO_BOTTOM qualifier constrains all children of an element that are uncontrolled.
2.2 /LOG
Format options: /LOG /NOLOG (default) Specifies whether CDO displays text identifying each element as the element is constrained.
3 – Description
The CONSTRAIN command moves an uncontrolled element to a base partition, the first level of approval. An uncontrolled element can be one of the following: o A field, record, or generic element that you created with Oracle CDD/Repository Version 4.0 or later o A field, record, or generic element that you created with Oracle CDD/Repository, outside a context Since fields, records, and generic elements are versioned elements, the CONSTRAIN command constrains the highest visible version unless you specify another version number. Before you issue the CONSTRAIN command, you must create a partition and a context for the uncontrolled element and issue the SET CONTEXT command to this context. The element you are constraining must be a versioned element. When you constrain one version of an element, CDO constrains all versions of the element. An error occurs if you attempt to constrain an element that is reserved. The SHOW RESERVATIONS command indicates whether this condition exists. An error occurs if you attempt to constrain an element that is a parent of an uncontrolled element. Constrain the parent and children simultaneously by issuing the CONSTRAIN command with the /CLOSURE=TO_BOTTOM qualifier. After you constrain an element, you issue the ATTACH TO COMPOSITE command to explicitly attach the element to a collection, field, record, file, or generic element. NOTE The CONSTRAIN command is irreversible. A controlled element cannot be changed to an uncontrolled element. All subsequent versions of the element are controlled. To create subsequent versions, issue the RESERVE command rather than the DEFINE command.
4 – Examples
CDO> DEFINE CONTEXT SUBSCRIPTIONS BASE_PARTITION FOURTH_QUARTER. CDO> SET CONTEXT SUBSCRIPTIONS CDO> DEFINE COLLECTION MAIL_LABEL. CDO> CONSTRAIN FIELD * In this example, the CONSTRAIN command controls all fields in the current default directory. See the ATTACH_TO_COMPOSITE command for commands to attach the constrained fields to this collection.