Format SET CONTEXT [ context-name ] [ AUDIT IS /*text*/ ]
1 – Parameters
1.1 – context-name
Specifies the context you are setting. If you omit this parameter, CDO sets the current context to null.
1.2 – 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 – Description
The SET CONTEXT command defines a context as the current context and implicitly controls all versioned elements that you define while the context is set. A context is a nonversioned element. Do not include a version number in the context name. If the top collection associated with the context is undefined, the SET CONTEXT command takes the element named in the next command as the top collection for the context. An error occurs if the next command is not a DEFINE COLLECTION command. The context set remains the current context until you issue another SET CONTEXT command, you delete the context, or you end the CDO session. As an alternative to the SET CONTEXT command, you can define the CDD$CONTEXT logical name. Once set, this context becomes the current context each time you access the repository. For example: $ DEFINE CDD$CONTEXT "cdd$disk:[smith.rep]test_context"
3 – Examples
CDO> DEFINE PARTITION FIRST_BASELEVEL. CDO> DEFINE CONTEXT DEVELOPMENT_CONTEXT. cont> BASE_PARTITION FIRST_BASELEVEL. CDO> SET CONTEXT DEVELOPMENT_CONTEXT CDO> DEFINE COLLECTION COMPILER_C. 1 CDO> RESERVE COLLECTION COMPILER_C CDO> DEFINE COLLECTION FRONT_END. CDO> DEFINE COLLECTION BACK_END. CDO> REPLACE COLLECTION COMPILER_C. CDO> SET CONTEXT 2 CDO> DEFINE RECORD ISSUES. In this example, the SET CONTEXT command sets the current context and implicitly defines a collection as the top collection. Subsequent definitions will be implicitly controlled. 1 The DEFINE COLLECTION command sets the top collection for the current context. All definitions made within the current context are attached to the top collection. FRONT_END and BACK_END are attached to COMPILER_C. 2 The SET CONTEXT command sets the current context to a null value. ISSUES is uncontrolled and unattached because it is defined outside a context.