Skip Headers
Oracle® OLAP Reference
10g Release 2 (10.2)

Part Number B14350-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

Example: Creating a Dimension Attribute

The following statement creates a dimension attribute, PRODUCT_DIM_BRAND, for the PRODUCT_DIM dimension in the JSMITH schema. The display name is Brand. The short description is Brand Name, and the description is Product Brand Name.

execute cwm2_olap_dimension_attribute.create_dimension_attribute 
     ('JSMITH', 'PRODUCT_DIM', 'PRODUCT_DIM_BRAND', 
      'Brand', 'Brand Name', 'Product Brand Name');

The following statement creates a dimension attribute, 'Short Description', for the PRODUCT_DIM dimension in the JSMITH schema. Short Description is a reserved dimension attribute.

execute cwm2_olap_dimension_attribute.create_dimension_attribute 
     ('JSMITH', 'PRODUCT_DIM', 'Short Description', 
      'Short Product Names', 'Short Desc Product', 
      'Short Name of Products', TRUE);

Summary of CWM2_OLAP_DIMENSION_ATTRIBUTE Subprograms

Table 12-2 CWM2_OLAP_DIMENSION_ATTRIBUTE Subprograms

Subprogram Description

CREATE_DIMENSION_ATTRIBUTE Procedure


Creates a dimension attribute.

DROP_DIMENSION_ATTRIBUTE Procedure


Drops a dimension attribute.

LOCK_DIMENSION_ATTRIBUTE Procedure


Locks the dimension attribute for update.

SET_DESCRIPTION Procedure

Sets the description for a dimension attribute.

SET_DIMENSION_ATTRIBUTE_NAME Procedure


Sets the name of a dimension attribute.

SET_DISPLAY_NAME Procedure

Sets the display name for a dimension attribute.

SET_SHORT_DESCRIPTION Procedure


Sets the short description for a dimension attribute.



CREATE_DIMENSION_ATTRIBUTE Procedure

This procedure creates a new dimension attribute.

If the dimension attribute is reserved, you can specify the reserved name as the dimension attribute name or as a type associated with a name that you specify. The reserved dimension attributes are listed in Table 12-1, "Reserved Dimension Attributes".

If the dimension attribute name should be reserved for mapping specific groups of level attributes, you can set the RESERVED_DIMENSION_ATTRIBUTE argument to TRUE. For more information, see Table 12-1, "Reserved Dimension Attributes".

Descriptions and display properties must also be established as part of dimension attribute creation. Once the dimension attribute has been created, you can override these properties by calling other procedures in this package.

Syntax

CREATE_DIMENSION_ATTRIBUTE (
          dimension_owner               IN   VARCHAR2,
          dimension_name                IN   VARCHAR2,
          dimension_attribute_name      IN   VARCHAR2,
          display_name                  IN   VARCHAR2,
          short_description             IN   VARCHAR2,
          description                   IN   VARCHAR2,
            type                        IN   VARCHAR2             );
            use_name_as_type            IN   BOOLEAN DEFAULT FALSE);

Parameters

Table 12-3 CREATE_DIMENSION_ATTRIBUTE Procedure Parameters

Parameter Description

dimension_owner

Owner of the dimension.

dimension_name

Name of the dimension.

dimension_attribute_name

Name of the dimension attribute.

display_name

Display name for the dimension attribute.

short_description

Short description of the dimension attribute.

description

Description of the dimension attribute.

type oruse_name_as_type

This argument can be one of the following:

  • type a VARCHAR2 argument whose value is one of the reserved names from Table 12-1, "Reserved Dimension Attributes". Specify this argument if you want to create your own name for a reserved dimension attribute.

  • use_name_as_type a BOOLEAN argument that defaults to FALSE. This argument specifies whether or not the dimension attribute name is a reserved name. If this argument is TRUE, the value of the dimension_attribute_name argument must be a reserved name from Table 12-1, "Reserved Dimension Attributes".

If you do not specify a value for this argument, the dimension attribute is not reserved.



DROP_DIMENSION_ATTRIBUTE Procedure

This procedure drops a dimension attribute.

Syntax

DROP_DIMENSION_ATTRIBUTE (
         dimension_owner               IN   VARCHAR2,
         dimension_name                IN   VARCHAR2,
         dimension_attribute_name      IN   VARCHAR2);

Parameters

Table 12-4 DROP_DIMENSION_ATTRIBUTE Procedure Parameters

Parameter Description

dimension_owner

Owner of the dimension.

dimension_name

Name of the dimension.

dimension_attribute_name

Name of the dimension attribute.



LOCK_DIMENSION_ATTRIBUTE Procedure

This procedure locks the dimension attribute for update by acquiring a database lock on the row that identifies the dimension attribute in the CWM2 model table.

Syntax

LOCK_DIMENSION_ATTRIBUTE (
           dimension_owner              IN   VARCHAR2,
           dimension_name               IN   VARCHAR2,
           dimension_attribute_name     IN   VARCHAR2,
           wait_for_lock                IN   BOOLEAN DEFAULT FALSE);

Parameters

Table 12-5 LOCK_DIMENSION_ATTRIBUTE Procedure Parameters

Parameter Description

dimension_owner

Owner of the dimension.

dimension_name

Name of the dimension.

dimension_attribute_name

Name of the dimension attribute.

wait_for_lock

(Optional) Whether or not to wait for the dimension attribute to be available when it is already locked by another user. If you do not specify a value for this parameter, the procedure does not wait to acquire the lock.



SET_DESCRIPTION Procedure

This procedure sets the description for a dimension attribute.

Syntax

SET_DESCRIPTION (
          dimension_owner              IN   VARCHAR2,
          dimension_name               IN   VARCHAR2,
          dimension_attribute_name     IN   VARCHAR2,
          description                  IN   VARCHAR2);

Parameters

Table 12-6 SET_DESCRIPTION Procedure Parameters

Parameter Description

dimension_owner

Owner of the dimension.

dimension_name

Name of the dimension.

dimension_attribute_name

Name of the dimension attribute.

description

Description of the dimension attribute.



SET_DIMENSION_ATTRIBUTE_NAME Procedure

This procedure sets the name for a dimension attribute.

If the dimension attribute is reserved, you can specify the reserved name as the dimension attribute name or as a type associated with a name that you specify. The reserved dimension attributes are listed in Table 12-1, "Reserved Dimension Attributes".

Syntax

SET_DIMENSION_ATTRIBUTE_NAME (
          dimension_owner                  IN   VARCHAR2,
          dimension_name                   IN   VARCHAR2,
          dimension_attribute_name         IN   VARCHAR2,
          set_dimension_attribute_name     IN   VARCHAR2,
            type                           IN   VARCHAR2             );
            use_name_as_type               IN   BOOLEAN DEFAULT FALSE);

Parameters

Table 12-7 SET_DIMENSION__ATTRIBUTE_NAME Procedure Parameters

Parameter Description

dimension_owner

Owner of the dimension.

dimension_name

Name of the dimension.

dimension_attribute_name

Original name for the dimension attribute.

set_dimension_attribute_name

New name for the dimension attribute.

type oruse_name_as_type

This argument can be one of the following:

  • type a VARCHAR2 argument whose value is one of the reserved names from Table 12-1, "Reserved Dimension Attributes". Specify this argument if you want to create your own name for a reserved dimension attribute.

  • use_name_as_type a BOOLEAN argument that defaults to FALSE. This argument specifies whether or not the dimension attribute name is a reserved name. If this argument is TRUE, the value of the dimension_attribute_name argument must be a reserved name from Table 12-1, "Reserved Dimension Attributes".

If you do not specify a value for this argument, the dimension attribute is not reserved.



SET_DISPLAY_NAME Procedure

This procedure sets the display name for a dimension attribute.

Syntax

SET_DISPLAY_NAME (
          dimension_owner              IN   VARCHAR2,
          dimension_name               IN   VARCHAR2,
          dimension_attribute_name     IN   VARCHAR2,
          display_name                 IN   VARCHAR2);

Parameters

Table 12-8 SET_DISPLAY_NAME Procedure Parameters

Parameter Description

dimension_owner

Owner of the dimension.

dimension_name

Name of the dimension.

dimension_attribute_name

Name of the dimension attribute.

display_name

Display name for the dimension attribute.



SET_SHORT_DESCRIPTION Procedure

This procedure sets the short description for a dimension attribute.

Syntax

SET_SHORT_DESCRIPTION (
          dimension_owner             IN   VARCHAR2,
          dimension_name              IN   VARCHAR2,
          dimension_attribute_name    IN   VARCHAR2,
          short_description           IN   VARCHAR2);

Parameters

Table 12-9 SET_SHORT_DESCRIPTION Procedure Parameters

Parameter Description

dimension_owner

Owner of the dimension.

dimension_name

Name of the dimension.

dimension_attribute_name

Name of the dimension attribute.

short_description

Short description of the dimension attribute.