Format { COLLECTION } { FIELD } ATTACH { FILE_ELEMENT type-name } [ qualifier ] element-name ,... { GENERIC type-name } { } { RECORD } TO composite-name [ AUDIT IS /*text*/ ]
1 – Parameters
1.1 – type-name
Specifies the type of file or generic element to which you are attaching.
1.2 – element-name
Specifies the element to which you are attaching. You can substitute an asterisk (*) wildcard character for this parameter.
1.3 – composite-name
Specifies the collection, field, record, file, or generic element to which you are attaching.
1.4 – text
Adds information to the history list entry. Valid delimiters are /* */ or double quotation marks (" "). You can use Japanese to document comments in the 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 /LOG
Format options: /LOG /NOLOG (default) Specifies whether CDO displays text identifying each element as the element is attached.
3 – Description
The ATTACH TO COMPOSITE command attaches a controlled element to the composite you specify. The element then becomes a child of the composite to which you are attaching. Before you issue the ATTACH TO COMPOSITE command, you must have set a context and reserved a composite. The SHOW CONTEXT and SHOW RESERVATIONS commands indicate whether these conditions exist. You can use the ATTACH TO COMPOSITE command in conjunction with the DEFINE, RESERVE, REPLACE, and DETACH commands to link collections in collection hierarchies. See the DEFINE COLLECTION command for an example of a collection hierarchy. You can also use the DETACH FROM COMPOSITE and ATTACH TO COMPOSITE commands to move between lines of descent. See the Oracle CDD/Repository Architecture Manual for more information on lines of descent.
4 – Examples
1.CDO> DEFINE PARTITION FIRST_QUARTER AUTOPURGE. CDO> DEFINE CONTEXT SALES cont> BASE_PARTITION FIRST_QUARTER. CDO> SET CONTEXT SALES CDO> DEFINE COLLECTION SALES_EACH_PRODUCT. CDO> CONSTRAIN FIELD PART_NUMBER CDO> RESERVE COLLECTION SALES_EACH_PRODUCT CDO> ATTACH FIELD PART_NUMBER TO SALES_EACH_PRODUCT CDO> REPLACE COLLECTION SALES_EACH_PRODUCT In this example, the ATTACH TO COMPOSITE command attaches the PART_NUMBER field to the SALES_EACH_PRODUCT collection. 2.CDO> RESERVE COLLECTION EMPLOYEE_RECORDS CDO> DETACH FIELD FIRST_NAME(2:BRANCH:2) FROM EMPLOYEE_RECORDS CDO> ATTACH FIELD FIRST_NAME(2) TO EMPLOYEE_RECORDS CDO> REPLACE COLLECTION EMPLOYEE_RECORDS In this example, the ATTACH TO COMPOSITE command attaches a version in the main line of descent, FIRST_NAME(2), to the EMPLOYEE_RECORDS collection. This allows you to create further versions in the main line, instead of in the branch line where you had been working.