Oracle® OLAP Reference 10g Release 1 (10.1) Part Number B10334-02 |
|
|
View PDF |
The CWM2_OLAP_LEVEL_ATTRIBUTE
package provides procedures for managing level attributes.
This chapter discusses the following topics:
A level attribute is an OLAP metadata entity. This means that it is a logical object, identified by name and owner, within the OLAP Catalog.
A level attribute is a child entity of a level and a dimension attribute. A level attribute stores descriptive information about its related level. For example, a level containing product identifiers might have an associated level attribute that contains color information for each product.
Each level attribute maps to a column in a dimension table. The level attribute column must be in the same table as the column (or columns) for its associated level. Level attributes are fully described in .
Use the procedures in the CWM2_OLAP_LEVEL_ATTRIBUTE
package to create, drop, and lock level attributes, to assign level attributes to levels and dimension attributes, and to specify descriptive information for display purposes.
Several level attribute names are reserved, because they have special significance within CWM2
. Reserved level attributes are associated with reserved dimension attributes of the same name. Reserved level attributes will be mapped to columns containing specific information. The reserved level attributes are listed in Table 14-1.
Table 14-1 Reserved Level Attributes
The parent dimension, parent level, and parent dimension attribute must already exist in the OLAP Catalog before you can create a level attribute.
See Also:
|
The following statements create a color attribute for the lowest level and long descriptions for all four levels of the PRODUCT_DIM
dimension.
execute cwm2_olap_level_attribute.create_level_attribute ('JSMITH', 'PRODUCT_DIM', 'Product Color', 'PRODUCT_LVL', 'Product Color', 'PROD_STD_COLOR', 'Prod Color', 'Product Color'); execute cwm2_olap_level_attribute.create_level_attribute ('JSMITH', 'PRODUCT_DIM', 'Long Description', 'PRODUCT_LVL', 'Long Description','PRODUCT_STD_LLABEL', 'Product', 'Long Labels for individual products of the PRODUCT hierarchy', TRUE); execute cwm2_olap_level_attribute.create_level_attribute ('JSMITH', 'PRODUCT_DIM', 'Long Description', 'PROD_SUBCATEGORY_LVL', 'Long Description', 'PROD_STD_LLABEL', 'Product Sub Category', 'Long Labels for subcategories of the PRODUCT hierarchy', TRUE); execute cwm2_olap_level_attribute.create_level_attribute ('JSMITH', 'PRODUCT_DIM', 'Long Description', 'PROD_CATEGORY_LVL', 'Long Description', 'PROD_STD_LLABEL', 'Product Category', 'Long Labels for categories of the PRODUCT hierarchy', TRUE); execute cwm2_olap_level_attribute.create_level_attribute ('JSMITH', 'PRODUCT_DIM', 'Long Description', 'TOTALPROD_LVL', 'Long Description', 'PROD_STD_LLABEL', 'Total Product', 'Long Labels for total of the PRODUCT hierarchy', TRUE);
Table 14-2 CWM2_OLAP_LEVEL_ATTRIBUTE Subprograms
Subprogram | Description |
---|---|
CREATE_LEVEL_ATTRIBUTE Procedure |
Creates a level attribute. |
DROP_LEVEL_ATTRIBUTE Procedure |
Drops a level attribute. |
LOCK_LEVEL_ATTRIBUTE Procedure |
Locks the level attribute metadata for update. |
SET_DESCRIPTION Procedure |
Sets the description for a level attribute. |
SET_DISPLAY_NAME Procedure |
Sets the display name for a level attribute. |
SET_LEVEL_ATTRIBUTE_NAME Procedure |
Sets the name of a level attribute. |
SET_SHORT_DESCRIPTION Procedure |
Sets the short description for a level attribute. |
This procedure creates a new level attribute in the OLAP Catalog and associates the level attribute with a level and with a dimension attribute.
If the level attribute is reserved, you can specify the reserved name as the level attribute name or as a type associated with a name that you specify. The reserved level attributes are listed in Table 14-1, "Reserved Level Attributes".
You must specify descriptions and display properties as part of level attribute creation. Once the level attribute has been created, you can override these properties by calling other procedures in the CWM2_OLAP_LEVEL_ATTRIBUTE
package.
Syntax
CREATE_LEVEL_ATTRIBUTE ( dimension_owner IN VARCHAR2, dimension_name IN VARCHAR2, dimension_attribute_name IN VARCHAR2, level_name IN VARCHAR2, level_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 14-3 CREATE_LEVEL_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 that includes this level attribute. |
level_name |
Name of the level. |
level_attribute_name |
Name of the level attribute. |
display_name |
Display name for the level attribute. |
short_description |
Short description of the level attribute. |
description |
Description of the level attribute. |
type oruse_name_as_type |
This argument can be one of the following:
If you do not specify a value for this argument, the level attribute is not reserved. |
This procedure drops a level attribute from the OLAP Catalog.
Syntax
DROP_LEVEL_ATTRIBUTE ( dimension_owner IN VARCHAR2, dimension_name IN VARCHAR2, dimension_attribute_name IN VARCHAR2, level_name IN VARCHAR2, level_attribute_name IN VARCHAR2);
Parameters
Table 14-4 DROP_LEVEL_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. |
level_name |
Name of the level. |
level_attribute_name |
Name of the level attribute. |
This procedure locks the level attribute metadata for update by acquiring a database lock on the row that identifies the level attribute in the CWM2
model table.
Syntax
LOCK_LEVEL_ATTRIBUTE ( dimension_owner IN VARCHAR2, dimension_name IN VARCHAR2, dimension_attribute_name IN VARCHAR2, level_name IN VARCHAR2, level_attribute_name IN VARCHAR2, wait_for_lock IN BOOLEAN DEFAULT FALSE);
Parameters
Table 14-5 LOCK_LEVEL_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. |
level_name |
Name of the level. |
level_attribute_name |
Name of the level attribute. |
wait_for_lock |
(Optional) Whether or not to wait for the level 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. |
This procedure sets the description for a level attribute.
Syntax
SET_DESCRIPTION ( dimension_owner IN VARCHAR2, dimension_name IN VARCHAR2, dimension_attribute_name IN VARCHAR2, level_name IN VARCHAR2, level_attribute_name IN VARCHAR2, description IN VARCHAR2);
Parameters
Table 14-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. |
level_name |
Name of the level. |
level_attribute_name |
Name of the level attribute. |
description |
Description of the level attribute. |
This procedure sets the display name for a level attribute.
Syntax
SET_DISPLAY_NAME ( dimension_owner IN VARCHAR2, dimension_name IN VARCHAR2, dimension_attribute_name IN VARCHAR2, level_name IN VARCHAR2, level_attribute_name IN VARCHAR2, display_name IN VARCHAR2);
Parameters
Table 14-7 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. |
level_name |
Name of the level. |
level_attribute_name |
Name of the level attribute. |
display_name |
Display name for the level attribute. |
This procedure sets the name for a level attribute.
If the level attribute is reserved, you can specify the reserved name as the level attribute name or as a type associated with a name that you specify. The reserved level attributes are listed in Table 14-1, "Reserved Level Attributes".
Syntax
SET_LEVEL_ATTRIBUTE_NAME ( dimension_owner IN VARCHAR2, dimension_name IN VARCHAR2, dimension_attribute_name IN VARCHAR2, level_name IN VARCHAR2, level_attribute_name IN VARCHAR2, set_level_attribute_name IN VARCHAR2, type IN VARCHAR2 ); use_name_as_type IN BOOLEAN DEFAULT FALSE);
Parameters
Table 14-8 SET_LEVEL_ATTRIBUTE_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. |
level_name |
Name for the level. |
level_attribute_name |
Original name for the level attribute. |
set_level_attribute_name |
New name for the level attribute. |
type oruse_name_as_type |
This argument can be one of the following:
If you do not specify a value for this argument, the level attribute is not reserved. |
This procedure sets the short description for a level attribute.
Syntax
SET_SHORT_DESCRIPTION ( dimension_owner IN VARCHAR2, dimension_name IN VARCHAR2, dimension_attribute_name IN VARCHAR2, level_name IN VARCHAR2, level_attribute_name IN VARCHAR2, short_description IN VARCHAR2);
Parameters
Table 14-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. |
level_name |
Name of the level. |
level_attribute_name |
Name of the level attribute. |
short_description |
Short description of the level attribute. |