Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Question about Create Dimension

783956Aug 7 2010 — edited Aug 7 2010
Good morning,

I am reading the Oracle Concepts document and on page 4-22 it presents a "CREATE DIMENSION" statement used to create the "customers_dim" dimension in the sample schema SH.

The statement presented is:
CREATE DIMENSION customers_dim
   LEVEL customer IS (customers.cust_id)
   LEVEL city IS (customers.cust_city)
   LEVEL state IS (customers.cust_state_province)
   LEVEL country IS (countries.country_id)
   LEVEL subregion IS (countries.country_subregion)
   LEVEL region IS (countries.country_region)
   HIERARCHY geog_rollup (
     customer CHILD OF
     city CHILD OF
     state CHILD OF
     country CHILD OF
     subregion CHILD OF
     region
  JOIN KEY (customers.country_id) REFERENCES country )
  ATTRIBUTE customer DETERMINES
    (cust_first_name, cust_last_name, cust_gender,
    cust_marital_status, cust_year_of_birth,
    cust_income_level, cust_credit_limit)
  ATTRIBUTE country DETERMINES (countries.country_name);
When I issued the above statement (verbatim from the document), I got the following error:
SQL> @customers_dim
LEVEL customer IS (customers.cust_id)
      *
ERROR at line 2:
ORA-30371: column cannot define a level in more than one dimension
I found the following using Google:
Cause:	A column was used in the definition of a level after it had already
        been used to define a level in a different dimension.
But, I don't see how the cust_id is defining a level in more than one dimension. There is probably a trivial error someplace but, I don't know enough yet about dimensions to figure it out.

Help is appreciated, thank you,

John.
This post has been answered by odie_63 on Aug 7 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 4 2010
Added on Aug 7 2010
11 comments
1,777 views