Oracle® OLAP Reference 10g Release 1 (10.1) Part Number B10334-02 |
|
|
View PDF |
The CWM2_OLAP_LEVEL
package provides procedures for managing levels.
This chapter discusses the following topics:
A level is an OLAP metadata entity. This means that it is a logical object, identified by name and owner, within the OLAP Catalog.
Dimension members are organized in levels that map to columns in dimension tables or views. Levels are typically organized in hierarchies. Every dimension must have at least one level. Levels are fully described in
Use the procedures in the CWM2_OLAP_LEVEL
package to create, drop, and lock levels, to assign levels to hierarchies, and to specify descriptive information for display purposes.
The parent dimension and the parent hierarchy must already exist in the OLAP Catalog before you can create a level.
See Also:
|
The following statements create four levels for the PRODUCT_DIM
dimension and assign them to the PRODUCT_DIM_ROLLUP
hierarchy.
execute cwm2_olap_level.create_level ('JSMITH', 'PRODUCT_DIM', 'TOTALPROD_LVL', 'Total Product', 'All Products', 'Total', 'Equipment and Parts of standard product hierarchy'); execute cwm2_olap_level.create_level ('JSMITH', 'PRODUCT_DIM', 'PROD_CATEGORY_LVL', 'Product Category', 'Product Categories', 'Category', 'Categories of standard product hierarchy'); execute cwm2_olap_level.create_level ('JSMITH', 'PRODUCT_DIM', 'PROD_SUBCATEGORY_LVL', 'Product Sub-Category', 'Product Sub-Categories', 'Sub-Category', 'Sub-Categories of standard product hierarchy'); execute cwm2_olap_level.create_level ('JSMITH', 'PRODUCT_DIM', 'PRODUCT_LVL', 'Product', 'Products', 'Product', 'Individual products of standard product hierarchy'); execute cwm2_olap_level.add_level_to_hierarchy ('JSMITH', 'PRODUCT_DIM', 'PRODUCT_DIM_ROLLUP', 'PRODUCT_LVL', 'PROD_SUBCATEGORY_LVL'); execute cwm2_olap_level.add_level_to_hierarchy ('JSMITH', 'PRODUCT_DIM', 'PRODUCT_DIM_ROLLUP', 'PROD_SUBCATEGORY_LVL', 'PROD_CATEGORY_LVL'); execute cwm2_olap_level.add_level_to_hierarchy ('JSMITH', 'PRODUCT_DIM', 'PRODUCT_DIM_ROLLUP', 'PROD_CATEGORY_LVL', 'TOTALPROD_LVL'); execute cwm2_olap_level.add_level_to_hierarchy ('JSMITH', 'PRODUCT_DIM', 'PRODUCT_DIM_ROLLUP', 'TOTALPROD_LVL');
Table 13-1 CWM2_OLAP_LEVEL Subprograms
Subprogram | Description |
---|---|
ADD_LEVEL_TO_HIERARCHY Procedure |
Adds a level to a hierarchy. |
CREATE_LEVEL Procedure |
Creates a level. |
DROP_LEVEL Procedure |
Drops a level. |
LOCK_LEVEL Procedure |
Locks the level metadata for update. |
REMOVE_LEVEL_FROM_HIERARCHY Procedure |
Removes a level from a hierarchy. |
SET_DESCRIPTION Procedure |
Sets the description for a level. |
SET_DISPLAY_NAME Procedure | Sets the display name for a level. |
SET_LEVEL_NAME Procedure |
Sets the name of a level. |
SET_PLURAL_NAME Procedure |
Sets the plural name for a level. |
SET_SHORT_DESCRIPTION Procedure |
Sets the short description for a level. |
This procedure adds a level to a hierarchy.
Syntax
ADD_LEVEL_TO_HIERARCHY ( dimension_owner IN VARCHAR2, dimension_name IN VARCHAR2, hierarchy_name IN VARCHAR2, level_name IN VARCHAR2, parent_level_name IN VARCHAR2 DEFAULT NULL);
Parameters
Table 13-2 ADD_LEVEL_TO_HIERARCHY Procedure Parameters
Parameter | Description |
---|---|
dimension_owner |
Owner of the dimension. |
dimension_name |
Name of the dimension. |
hierarchy_name |
Name of the hierarchy. |
level_name |
Name of the level to add to the hierarchy. |
parent_level_name |
Name of the level's parent in the hierarchy. If you do not specify a parent, then the added level is the root of the hierarchy. |
This procedure creates a new level in the OLAP Catalog.
You must specify descriptions and display properties as part of level creation. Once the level has been created, you can override these properties by calling other procedures in the CWM2_OLAP_LEVEL
package.
Syntax
CREATE_LEVEL ( dimension_owner IN VARCHAR2, dimension_name IN VARCHAR2, level_name IN VARCHAR2, display_name IN VARCHAR2, plural_name IN VARCHAR2, short_description IN VARCHAR2, description IN VARCHAR2);
Parameters
Table 13-3 CREATE_LEVEL Procedure Parameters
Parameter | Description |
---|---|
dimension_owner |
Owner of the dimension. |
dimension_name |
Name of the dimension. |
level_name |
Name of the level. |
display_name |
Display name for the level. |
plural_name |
Plural name for the level. |
short_description |
Short description of the level. |
description |
Description of the level. |
This procedure drops a level from the OLAP Catalog. All related level attributes are also dropped.
Syntax
DROP_LEVEL ( dimension_owner IN VARCHAR2, dimension_name IN VARCHAR2, level_name IN VARCHAR2);
Parameters
Table 13-4 DROP_LEVEL Procedure Parameters
Parameter | Description |
---|---|
dimension_owner |
Owner of the dimension. |
dimension_name |
Name of the dimension. |
level_name |
Name of the level. |
This procedure locks the level metadata for update by acquiring a database lock on the row that identifies the level in the CWM2
model table.
Syntax
LOCK_LEVEL ( dimension_owner IN VARCHAR2, dimension_name IN VARCHAR2, level_name IN VARCHAR2, wait_for_lock IN BOOLEAN DEFAULT FALSE);
Parameters
Table 13-5 LOCK_LEVEL Procedure Parameters
Parameter | Description |
---|---|
dimension_owner |
Owner of the dimension. |
dimension_name |
Name of the dimension. |
level_name |
Name of the level. |
wait_for_lock |
(Optional) Whether or not to wait for the level 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 removes a level from a hierarchy.
Syntax
REMOVE_LEVEL_FROM_HIERARCHY ( dimension_owner IN VARCHAR2, dimension_name IN VARCHAR2, hierarchy_name IN VARCHAR2, level_name IN VARCHAR2);
Parameters
Table 13-6 REMOVE_LEVEL_FROM_HIERARCHY Procedure Parameters
Parameter | Description |
---|---|
dimension_owner |
Owner of the dimension. |
dimension_name |
Name of the dimension. |
hierarchy_name |
Name of the hierarchy. |
level_name |
Name of the level to remove from the hierarchy. |
This procedure sets the description for a level.
Syntax
SET_DESCRIPTION ( dimension_owner IN VARCHAR2, dimension_name IN VARCHAR2, level_name IN VARCHAR2, description IN VARCHAR2);
Parameters
Table 13-7 SET_DESCRIPTION Procedure Parameters
Parameter | Description |
---|---|
dimension_owner |
Owner of the dimension. |
dimension_name |
Name of the dimension. |
level_name |
Name of the level. |
description |
Description of the level. |
This procedure sets the display name for a level.
Syntax
SET_DISPLAY_NAME ( dimension_owner IN VARCHAR2, dimension_name IN VARCHAR2, level_name IN VARCHAR2, display_name IN VARCHAR2);
Parameters
Table 13-8 SET_DISPLAY_NAME Procedure Parameters
Parameter | Description |
---|---|
dimension_owner |
Owner of the dimension. |
dimension_name |
Name of the dimension. |
level_name |
Name of the level. |
display_name |
Display name for the level. |
This procedure sets the name for a level.
Syntax
SET_LEVEL_NAME ( dimension_owner IN VARCHAR2, dimension_name IN VARCHAR2, level_name IN VARCHAR2, set_level_name IN VARCHAR2);
Parameters
Table 13-9 SET_LEVEL_NAME Procedure Parameters
Parameter | Description |
---|---|
dimension_owner |
Owner of the dimension. |
dimension_name |
Name of the dimension. |
level_name |
Original name for the level. |
set_level_name |
New name for the level. |
This procedure sets the plural name of a level.
Syntax
SET_PLURAL_NAME ( dimension_owner IN VARCHAR2, dimension_name IN VARCHAR2, level_name IN VARCHAR2, plural_name IN VARCHAR2);
Parameters
Table 13-10 SET_PLURAL_NAME Procedure Parameters
Parameter | Description |
---|---|
dimension_owner |
Owner of the dimension. |
dimension_name |
Name of the dimension. |
level_name |
Name of the level. |
plural_name |
Plural name for the level. |
This procedure sets the short description for a level.
Syntax
SET_SHORT_DESCRIPTION ( dimension_owner IN VARCHAR2, dimension_name IN VARCHAR2, level_name IN VARCHAR2, short_description IN VARCHAR2);
Parameters