Using AW_EXPR in OLAP_TABLE

Hi all,
What datatypes are supported by AW_EXPR ? Were can I find more info on AW_EXPR ?
These questions arise after having track down an error using the OLAP_TABLE function. I was trying to fetch the combined value for the boolean OLAP NASkip and NASkip2 settings using the following select statement :
select * from table(olap_table('', '', '', 'measure NASettings from aw_expr NASkip and NASkip2'))
Clearly AW_EXPR is needed here because I fetch an expression of existing OLAP objects and not an existing OLAP object itself. However, this statement fails.
For your info, both following statements run correctly :
select * from table(olap_table('', '', '', 'measure NASettings from aw_expr Convert(NASkip and NASkip2, Integer)'))
select * from table(olap_table('', '', '', 'measure NASettings from aw_expr Convert(NASkip and NASkip2, Text)'))
Also this is possible :
select * from table(olap_table('', '', '', 'measure NASkip from NASkip, measure NASkip2 from NASkip2'))
but then the AND has still to be executed ...
Thanks in advance for giving me some info on the possibilities/limitations of AW_EXPR.
Mark

The original error message is
select * from table(olap_table('', '', '', 'measure NASettings from aw_expr NASkip and NASkip2'))
ERROR at line 1:
ORA-29913: error in executing ODCITABLESTART callout
ORA-00600: internal error code, arguments: [17183], [0xA1A0B70], [], [], [], [], [], []
ORA-34100: Values of type NUMBER are expected.
Adding parenthesis doesn't change a thing. The error remains the same.
Mark

Similar Messages

  • How to use HIERARCHY in OLAP_TABLE function

    Hello,
    I am new to OLAP and I don't really know what is the exact syntax to look at this cube by using sql and OLAP_TABLE function.
    I have defined a analytic workspace called 'MANUAL' by using Analytic Workspace Manager. Inside I have defined a simple dimension 'DIM_PERIOD'.
    I have 4 levels ('YEAR', 'QUARTER','MONTH','YEAR_MONTH'), 1 hierarchy ('PERIOD') and 6 attributes ('YEAR','QUARTER','MONTH_CODE','MONTH_LONG','MONTH_SHORT',
    'YEAR_MONTH'). Every attribute is linked to one level of the hierarchy..
    I would like to build the correct sql statement to see all my dimension.
    I have already build the following :
    create type awperiod_row AS OBJECT (
    tyear VARCHAR2(4000),
    tquarter VARCHAR2(4000));
    create type awperiod_table as table of awperiod_row;
    Select *
    from table (OLAP_TABLE(
    'manual DURATION SESSION',
    'awperiod_table',
    'DIMENSION tyear from dim_period));
    This is giving me all different level in only one column.
    If I introduce 'WITH HIERARCHY PERIOD' I have an error saying PERIOD is not an object of Manual.
    Is there somebody who can help me ?
    I am expecting the following simple result :
    Year Quarter Monthshort
    2005 1 Jan
    2005 1 Feb
    2005 1 Mar
    2005 2 Apr
    Note also the definition and the data of my dimension is good. I can see the correct contain by using Analytic Workspace Manager
    Thanks already

    The answer to your overall question is that you should use the familyrel keyword in your limitmap, once per level that you want represented as a column (or a single reference along with the USING clause). You would also need to reference these new columns in your ADT.
    But before you start using familyrel, you'll need to discover why you can't specify a hierarchy. My guess is that period is not the name of the hierarchy in the Analytic Workspace. You can list all available hierarchies by using OLAP Worksheet (available in AWM) and typing "listnames relations aw period".
    It is somewhat difficult to be more specific without more detailed knowledge of the underlying Analytic Workspace.
    Thanks.

  • ORA-21700 in re-creating ADT for OLAP_TABLE

    I'm trying to create a script that can automate the process of generating abstract data types for use in an OLAP_TABLE function. I'm following the examples in the documentation. Everything runs great the FIRST time I run my script, but when I drop my types and re-create them, when I run the next SELECT statement against the OLAP_TABLE function, I get:
    ERROR at line 1:
    ORA-21700: object does not exist or is marked for delete
    My script drops the ADTs before creating, but somehow they are not REALLY being dropped.
    SET ECHO ON
    SET SERVEROUT ON
    DROP TYPE ts_table_6;
    DROP TYPE ts_row6;
    CREATE TYPE ts_row6 AS OBJECT(
    CONJ2002 VARCHAR2(400),
    CONJ2002_DATA number(16),
    PERIOD VARCHAR2(10),
    PERIOD_NAME VARCHAR2(20));
    CREATE TYPE ts_table_6 AS TABLE OF ts_row6;
    SELECT CONJ2002, period, period_name, conj2002_data FROM TABLE(OLAP_TABLE(
    'REFVLMTA DURATION QUERY',
    'ts_table_6',
    'limit CONJ2002 to first 3',
    'MEASURE CONJ2002_DATA from CONJ2002.DATA
    DIMENSION CONJ2002 from CONJ2002
    DIMENSION PERIOD from PERIOD WITH
    ATTRIBUTE PERIOD_NAME from period.name'));
    Again, it works the first time, but not the second time. I need to bump up the ADT names to ts_row7 and ts_table_7. SQL Plus says the types are being dropped.
    Any ideas?
    Dan Vlamis [email protected]

    This could be a caching problem and the recourse is to reinitialize the referencing object. You can flush the SQL library cache with the following command:
    alter system flush shared_pool;
    Also, you might want to use the force phase of the drop type command:
    drop type ts_table_6 force;
    drop type ts_row_6 force;
    If these solutions do not work, please contact Oracle Support. This may be a bug.

  • FETCH in OLAP_TABLE

    I use FETCH with OLAP_TABLE to query a migrated Express-AW with SQL. Is it possible to limit the variable before data is fetched within the SQL statement (e.g. with OLAP_CONDITION)? If yes, how is it done, because I couldn't figure it out.
    Thanks in advance and best regards,
    Marco

    hi marco,
    in the section OLAP_TABLE , you can add limit statements before fetch .
    as
    TABLE(OLAP_TABLE(
              'xademo DURATION SESSION',
              'measure_table',
              'limit time to first 1;FETCH time, geography, product, channel, analytic_cube_f.sales,
                   analytic_cube_f.costs,
                   LAG(analytic_cube_f.costs, 1, time, LEVELREL time_member_levelrel),
                   analytic_cube_f.sales - analytic_cube_f.costs',

  • "ORA-21700: object does not exist or is marked for delete" select from ADT

    Posted this in OLAP section as well, but since this is Object technology, I thought I would repeat it here. Sorry about the duplication.
    BTW, I'm using Oracle9i 9.2.0.4.1.
    I'm trying to create a script that can automate the process of generating abstract data types for use in an OLAP_TABLE function. I'm following the examples in the documentation. Everything runs great the FIRST time I run my script, but when I drop my types and re-create them, when I run the next SELECT statement against the OLAP_TABLE function, I get:
    ERROR at line 1:
    ORA-21700: object does not exist or is marked for delete
    My script drops the ADTs before creating, but somehow they are not REALLY being dropped.
    SET ECHO ON
    SET SERVEROUT ON
    DROP TYPE ts_table_6;
    DROP TYPE ts_row6;
    CREATE TYPE ts_row6 AS OBJECT(
    CONJ2002 VARCHAR2(400),
    CONJ2002_DATA number(16),
    PERIOD VARCHAR2(10),
    PERIOD_NAME VARCHAR2(20));
    CREATE TYPE ts_table_6 AS TABLE OF ts_row6;
    SELECT CONJ2002, period, period_name, conj2002_data FROM TABLE(OLAP_TABLE(
    'REFVLMTA DURATION QUERY',
    'ts_table_6',
    'limit CONJ2002 to first 3',
    'MEASURE CONJ2002_DATA from CONJ2002.DATA
    DIMENSION CONJ2002 from CONJ2002
    DIMENSION PERIOD from PERIOD WITH
    ATTRIBUTE PERIOD_NAME from period.name'));
    Again, it works the first time, but not the second time. I need to bump up the ADT names to ts_row7 and ts_table_7. SQL Plus says the types are being dropped.
    Any ideas?
    Dan Vlamis [email protected]

    Hi Dan
    What append if you do a connect between the DROP and the CREATE statements?
    Chris

  • How to report dimension using OLAP_TABLE

    Hello all,
    I am new to the OLAP DML. ANd struggling to make a good use of it.
    A dimension called BU is created in AWM with several hierarchy like BU_2004, BU_2005, BU_2006 etc. These are all value based hierarchies.
    Each hierarchy has the same dimension attributes (member, parent, long_description, short_description).
    How do I report all the attribute values from a hierarchy (example BU_2004).
    I am trying to write a sql with OLAP_TABLE and struggling. Can some of the experts out there help me?
    Thanks a lot.
    Parag.

    Hi Steve,
    Just wanted to check if you are able to resolve this issue? i am in the same boat and wanted to check if you have any solution.
    Thanks

  • ADVICE: Using ID Dimensions w/ OLAP_TABLE

    Some advice from a consultant in the UK...
    My discovery using AW dimensions with a datatype of ID with the OLAP_TABLE function - hopefully it will save you some time !!
    I have the follow objects in an AW which I migrated from OES 6.3.2:
    DEFINE DJ_DATE DIMENSION TEXT WIDTH 5
    DEFINE DJ_BAND DIMENSION TEXT WIDTH 3
    DEFINE DJ_INDUSTRY DIMENSION TEXT WIDTH 3
    DEFINE DJ_GEOG DIMENSION TEXT WIDTH 2
    DEFINE DJ_IDX_CURR DIMENSION ID
    DEFINE DJ_INDEX_VAL VARIABLE DECIMAL <DJ_DATE DJ_BAND DJ_CMP_1 <DJ_INDUSTRY DJ_GEOG DJ_IDX_CURR>>
    I create the following ADT's & Views:
    CREATE TYPE DFR_DJINDEXVAL AS OBJECT (
    dj_date DATE,
    dj_band VARCHAR2(3),
    dj_industry VARCHAR2(3),
    dj_geog VARCHAR2(2),
    dj_idx_curr VARCHAR2(3),
    dj_index_val NUMBER);
    CREATE TYPE DFT_DJINDEXVAL AS TABLE OF DFR_DJINDEXVAL;
    CREATE OR REPLACE VIEW DFV_DJINDEXVAL_OT AS SELECT * FROM TABLE (CAST (OLAP_TABLE (
    'DJ duration session',
    'DFT_DJINDEXVAL',
    'DIMENSION dj_date FROM dj_date
    DIMENSION dj_band FROM dj_band
    DIMENSION dj_industry FROM dj_industry
    DIMENSION dj_geog FROM dj_geog
    DIMENSION dj_idx_curr FROM dj_idx_curr
    MEASURE dj_index_val FROM dj_index_val
    LOOP dj_cmp_1
    AS DFT_DJINDEXVAL));
    I get an error when I issue the following query:
    select * from DFV_DJINDEXVAL_OT
    where dj_date = '06JUN00'
    and dj_industry = 'DOW'
    and dj_geog = 'W1'
    and dj_band = 'ALL'
    and dj_idx_curr = 'USD';
    select * from DFV_DJINDEXVAL_OT
    ERROR at line 1:
    ORA-29400: data cartridge error
    ORA-01401: inserted value too large for column
    WARNING 1) Despite having no values which exceed 3 characters in length, the dj_idx_curr AW dimension has been defined with datatype ID and therefore 8 characters will be inserted, regardless of content.
    The way round this is to change the column defintion in the ADT.
    CREATE TYPE DFR_DJINDEXVAL AS OBJECT (
    dj_date DATE,
    dj_band VARCHAR2(3),
    dj_industry VARCHAR2(3),
    dj_geog VARCHAR2(2),
    dj_idx_curr VARCHAR2(8),
    dj_index_val NUMBER);
    I can now select against the view without error, but I still don't get the result I expect:
    SQL> select * from DFV_DJINDEXVAL_OT
    2 where dj_date = '06JUN00'
    3 and dj_industry = 'DOW'
    4 and dj_geog = 'W1'
    5 and dj_band = 'ALL'
    6 and dj_idx_curr = 'USD';
    no rows selected
    WARNING 2) ID dimension values will be padded out with blank characters to make them up to a width of 8 characters.
    The following query gives me what I want:
    SQL> select * from DFV_DJINDEXVAL_OT
    2 where dj_date = '06JUN00'
    3 and dj_industry = 'DOW'
    4 and dj_geog = 'W1'
    5 and dj_band = 'ALL'
    6 and dj_idx_curr = 'USD ';
    DJ_DATE DJ_ DJ_ DJ DJ_IDX_C DJ_INDEX_VAL
    06JUN00 ALL DOW W1 USD 238.563007
    06JUN00 LRG DOW W1 USD 261.824481
    06JUN00 MID DOW W1 USD 200.667549
    06JUN00 SML DOW W1 USD 183.01086
    06JUN00 TOP DOW W1 USD
    06JUN00 LOW DOW W1 USD
    6 rows selected.
    This is obviously not ideal. A possible solution is to define another view and query this instead:
    CREATE OR REPLACE VIEW DFV_DJINDEXVAL AS SELECT
    dj_date,
    dj_band,
    dj_industry,
    dj_geog,
    rtrim(dj_idx_curr) dj_idx_curr,
    dj_index_val
    FROM DFV_DJINDEXVAL_OT;
    The following query gives me what I want:
    SQL> select * from DFV_DJINDEXVAL
    2 where dj_date = '06JUN00'
    3 and dj_industry = 'DOW'
    4 and dj_geog = 'W1'
    5 and dj_band = 'ALL'
    6 and dj_idx_curr = 'USD';
    DJ_DATE DJ_ DJ_ DJ DJ_IDX_C DJ_INDEX_VAL
    06JUN00 ALL DOW W1 USD 238.563007
    06JUN00 LRG DOW W1 USD 261.824481
    06JUN00 MID DOW W1 USD 200.667549
    06JUN00 SML DOW W1 USD 183.01086
    06JUN00 TOP DOW W1 USD
    06JUN00 LOW DOW W1 USD
    6 rows selected.
    Hope it helps.
    Stuart

    ADT objects were mandatory in 9.2 but are optional in 10.x
    As you are using 10.2, you should use automatic ADT's as shown here
    Stuart

  • Error using OLAP_TABLE

    HI,
    We have created a cube using AWM 9.2.0.4.1D, we are getting the error ORA-29913 and ora-33858 when trying to acess the cube using the following view.
    SELECT "NDIM_REPMONTH_ID","NDIM_REPMONTH_LEVEL","NDIM_REPMONTH_LVL_YEAR","NDIM_REPMONTH_LVL_YEAR_DESC","NDIM_REPMONTH_LVL_HYR","NDIM_REPMONTH_LVL_HYR_DESC","NDIM_REPMONTH_LVL_QTR","NDIM_REPMONTH_LVL_QTR_DESC","NDIM_REPMONTH_LVL_DESREPMONTH","NDIM_REPMONTH_LVL_DESREPMONT01","NDIM_REPMONTH_LVL_REPMONTH","NDIM_REPMONTH_LVL_REPMONTH_D01","NTEST_CUBE2_TOPUP_GROSSAMT","NTEST_CUBE2_TOTALBOUNCES" FROM TABLE(OLAP_TABLE('OLAPSYS.AWM_RISK DURATION session','BOBJ_NTEST_CUBE1_TABLE','','&BOBJ_NTEST_CUBE1_LIMIT_MAP'))
    regards
    Vishal

    Hi,
    What release of Oracle OLAP are you using?
    This error will have a corresponding entry in the database alert log and dump file which may provide more diagnostic information.
    Looking at the information you have provided, it is not clear to me why you have referenced TEST2 in your limitmap if the measure is called Oper_test2 ?
    Does the TEST2 cube really only have 1 dimension?
    Stuart

  • OLAP_TABLE performance issues

    Please advice. OLAP_TABLE performance is slow and SELECT did not return data after running for > 10 hours.
    ISSUES:
    (1) I started with only one measure and one dimension in the OLAP_TABLE statement and it returned data. However, when I added the remaining measures and dimensions, the statement never return data. The end user required all 20 measures and all 7 dimensions. How can I overcome the performance issue and get the data from the cube? Please HELP!
    (2) The cube is compressed. I read articles saying that OLAP_TABLE cannot use the LOOP keyword when cube is being compressed. I have already using MODEL keyword and the statement did not come back. How can I improve the performance and return data?
    (3) Can I create MV using OLAP_TABLE in 10g? If not, is there anyway to get around without MV because the VIEW is killing the performance so badly (it simply did not return and has to be killed manually).
    (4) I also used “AWM plug-in” to create the relational table view. However, all 20 measures and 7 dimensions must be included. It exceeded 4000 characters in single PL/SQL function parameter and caused the limitmap error. So the “AWM plug-in” did not work for me.
    Appreciate all of our help!
    (*) DATA
    1 Fact; 7 Dimensions; 1 cube; 20 measures
    POSITION_FACT - 9,387,384 rows
    DIM_BUSINESS_DAY - 2 rows - 1 hierarchy - 2 levels - 1 attribute
    DIM_INSTRUMENT_TYPE - 16 rows - 1 hierarchy - 2 levels - 1 attribute
    DIM_RISK_TYPE - 21 rows - 1 hierarchy - 2 levels - 1 attribute
    DIM_BOOK - 673 rows - 1 hierarchy - 10 levels - 2 attributes
    DIM_CURVE - 4,869 rows - 1 hierarchy - 6 levels - 1 attribute
    DIM_REFERENCE_ENTITY - 3,756 rows - 1 hierarchy - 7 levels - 3 attributes
    DIM_POSITION - 745,957 rows - 1 hierarchy - 2 levels - 9 attributes
    (*) CUBE CREATED IN AWM:
    fully pre-aggregated;
    used global composites;
    used compassion by integer;
    partition by business date;
    took minimum ~ 30 minutes to build the cube.
    ENVIRONMENT:
    (*) Oracle Database 10g Release 2 Patch Set 2 (10.2.0.3.0) 64-bit
    (*) 3 products installed in Oracle Home: Interim patches: 5746153 (OLAP 'A' patch), 5556081, 5557962
    (*) AWM 10.2.0.3.0A
    (*) SQL
    CREATE OR REPLACE VIEW vw_cube_bi_nrdb_vw_fl AS
    SELECT * FROM TABLE(OLAP_TABLE(
    'bi_nrdb DURATION SESSION',
    MEASURE am_value_total AS NUMBER FROM bi_nrdb_vw_total
    MEASURE am_value_03m AS NUMBER FROM bi_nrdb_vw_am_03m
    MEASURE am_value_06m AS NUMBER FROM bi_nrdb_vw_am_06m
    MEASURE am_value_09m AS NUMBER FROM bi_nrdb_vw_am_09m
    MEASURE am_value_01y AS NUMBER FROM bi_nrdb_vw_am_01y
    MEASURE am_value_18m AS NUMBER FROM bi_nrdb_vw_am_18m
    MEASURE am_value_02y AS NUMBER FROM bi_nrdb_vw_am_02y
    MEASURE am_value_03y AS NUMBER FROM bi_nrdb_vw_am_03y
    MEASURE am_value_04y AS NUMBER FROM bi_nrdb_vw_am_04y
    MEASURE am_value_05y AS NUMBER FROM bi_nrdb_vw_am_05y
    MEASURE am_value_06y AS NUMBER FROM bi_nrdb_vw_am_06y
    MEASURE am_value_07y AS NUMBER FROM bi_nrdb_vw_am_07y
    MEASURE am_value_08y AS NUMBER FROM bi_nrdb_vw_am_08y
    MEASURE am_value_09y AS NUMBER FROM bi_nrdb_vw_am_09y
    MEASURE am_value_10y AS NUMBER FROM bi_nrdb_vw_am_10y
    MEASURE am_value_12y AS NUMBER FROM bi_nrdb_vw_am_12y
    MEASURE am_value_15y AS NUMBER FROM bi_nrdb_vw_am_15y
    MEASURE am_value_20y AS NUMBER FROM bi_nrdb_vw_am_20y
    MEASURE am_value_30y AS NUMBER FROM bi_nrdb_vw_am_30y
    MEASURE am_value_40y AS NUMBER FROM bi_nrdb_vw_am_40y
    DIMENSION dim_business FROM dim_business_day WITH
    ATTRIBUTE dt_business FROM dim_business_day_long_description
    DIMENSION dim_risk_type FROM dim_risk_type WITH
    ATTRIBUTE id_risk_type FROM dim_risk_type_long_description
    DIMENSION dim_instrument_type FROM dim_instrument_type WITH
    ATTRIBUTE id_instrument_type FROM dim_instrument_type_long_description
    DIMENSION dim_book FROM dim_book WITH
    ATTRIBUTE nm_dim_book FROM dim_book_long_description
    ATTRIBUTE trader FROM dim_book_trader
    DIMENSION dim_reference_entity FROM dim_reference_entity WITH
    ATTRIBUTE nm_dim_reference_entity FROM dim_reference_entity_long_description
    ATTRIBUTE nm_spn_moody_rating FROM dim_reference_entity_spn_moody_rating
    ATTRIBUTE nm_spn_sp_rating FROM dim_reference_entity_spn_sp_rating
    DIMENSION dim_position FROM dim_position WITH
    ATTRIBUTE id_buysell FROM dim_position_buysell
    ATTRIBUTE id_coupon FROM dim_position_coupon
    ATTRIBUTE id_cusip FROM dim_position_cusip
    ATTRIBUTE id_isin FROM dim_position_isin
    ATTRIBUTE id_instrument_name FROM dim_position_instrument_name
    ATTRIBUTE id_maturity FROM dim_position_maturity
    ATTRIBUTE id_mtm FROM dim_position_mtm
    ATTRIBUTE id_notional FROM dim_position_notional
    MODEL
    DIMENSION BY (dim_business, dt_business, dim_risk_type, id_risk_type, dim_instrument_type, id_instrument_type,
    dim_book, nm_dim_book, trader, dim_reference_entity, nm_dim_reference_entity, nm_spn_moody_rating,
    nm_spn_sp_rating, dim_position, id_buysell, id_coupon, id_cusip, id_isin, id_instrument_name,
    id_maturity, id_mtm, id_notional)
    MEASURES (am_value_total, am_value_03m, am_value_06m, am_value_09m, am_value_01y,
    am_value_18m,am_value_02y, am_value_03y, am_value_04y, am_value_05y,
    am_value_06y, am_value_07y,am_value_08y, am_value_09y, am_value_10y,
    am_value_12y, am_value_15y, am_value_20y, am_value_30y, am_value_40y)
    RULES UPDATE SEQUENTIAL ORDER ();

    (1a) Thank you so much! The SQL “the CREATE OR REPLACE VIEW vw_cube_bi_nrdb_vw_fl…” the SQL I provided from my previous was the OLAP_STATEMENT I ran for > 10 hrs and killed manually. Please advice.
    I have business requirements to display all 7 dimensions and 20 measures for reporting. So I can’t really filter my dimensions much.
    (1b) Separately, I also follow your advice to add the WHERE clause after I created the VIEW vw_cube_bi_nrdb_vw_fl, see below statement and received error.
    SQL> select * from vw_cube_bi_nrdb_vw_fl
    where dt_business = '06/23/2008'
    and ID_RISK_TYPE ='CR01'
    and ID_INSTRUMENT_TYPE='VANILLA CDS'
    and dim_book='BOOK_63272279'
    AND dim_reference_entity='GFN_0113182'
    and dim_position='3645636' ;
    select * from vw_cube_bi_nrdb_vw_fl
    ERROR at line 1:
    ORA-32638: Non unique addressing in MODEL dimensions
    (4) I received below error when I ran “AWM plug-in” to create a VIEW from AWM. I have already uncheck fields that I do not need and only keeping the measures and dimensions I need. Sorry for the long err below:
    AUG-21-2008 12:14:47: . Creating view for cube BI_NRDB_AGGR
    AUG-21-2008 12:14:48: ..... generating limitmap for cube
    AUG-21-2008 12:14:48: ... generating limitmap for cube
    AUG-21-2008 12:14:48: ..... mapping table out of date for cube BI_NRDB_AGGR. Updating mapping table.
    AUG-21-2008 12:14:48: ... populating mapping for cube BI_NRDB_AGGR
    AUG-21-2008 12:14:48: ..... clearing mappings for the cube
    AUG-21-2008 12:14:48: ..... collecting metadata for measures in cube
    AUG-21-2008 12:14:48: ..... retrieving dimensions for the cube. Need limitmap for each dimension.
    AUG-21-2008 12:14:48: ... generating limitmap for DIM_BUSINESS_DAY
    AUG-21-2008 12:14:48: ..... mapping table out of date for dimension DIM_BUSINESS_DAY. Updating mapping table.
    AUG-21-2008 12:14:48: ... populating dimension map for DIM_BUSINESS_DAY
    AUG-21-2008 12:14:48: ..... clearing mappings for the dimension
    AUG-21-2008 12:14:48: ..... retrieving physical objects
    AUG-21-2008 12:14:48: ..... checking for value hierarchies
    AUG-21-2008 12:14:48: ..... retrieving label for dimension levels
    AUG-21-2008 12:14:48: ..... populating mapping info for the DIMENSION clause
    AUG-21-2008 12:14:48: ..... populating mapping info for the INHIERARCHY clause
    AUG-21-2008 12:14:48: ..... retrieving hierarchy information
    AUG-21-2008 12:14:48: ..... populating mapping info for the HIERARCHY and FAMILYREL clauses for hierarchy PRIM
    AUG-21-2008 12:14:48: ..... populating mapping info for the ATTRIBUTE clause
    AUG-21-2008 12:14:48: ... completed populating mapping for DIM_BUSINESS_DAY
    AUG-21-2008 12:14:48: ... generating limitmap for DIM_INSTRUMENT_TYPE
    AUG-21-2008 12:14:48: ..... mapping table out of date for dimension DIM_INSTRUMENT_TYPE. Updating mapping table.
    AUG-21-2008 12:14:48: ... populating dimension map for DIM_INSTRUMENT_TYPE
    AUG-21-2008 12:14:48: ..... clearing mappings for the dimension
    AUG-21-2008 12:14:48: ..... retrieving physical objects
    AUG-21-2008 12:14:48: ..... checking for value hierarchies
    AUG-21-2008 12:14:48: ..... retrieving label for dimension levels
    AUG-21-2008 12:14:48: ..... populating mapping info for the DIMENSION clause
    AUG-21-2008 12:14:48: ..... populating mapping info for the INHIERARCHY clause
    AUG-21-2008 12:14:48: ..... retrieving hierarchy information
    AUG-21-2008 12:14:49: ..... populating mapping info for the HIERARCHY and FAMILYREL clauses for hierarchy PRIM
    AUG-21-2008 12:14:49: ..... populating mapping info for the ATTRIBUTE clause
    AUG-21-2008 12:14:49: ... completed populating mapping for DIM_INSTRUMENT_TYPE
    AUG-21-2008 12:14:49: ... generating limitmap for DIM_RISK_TYPE
    AUG-21-2008 12:14:49: ..... mapping table out of date for dimension DIM_RISK_TYPE. Updating mapping table.
    AUG-21-2008 12:14:49: ... populating dimension map for DIM_RISK_TYPE
    AUG-21-2008 12:14:49: ..... clearing mappings for the dimension
    AUG-21-2008 12:14:49: ..... retrieving physical objects
    AUG-21-2008 12:14:49: ..... checking for value hierarchies
    AUG-21-2008 12:14:49: ..... retrieving label for dimension levels
    AUG-21-2008 12:14:49: ..... populating mapping info for the DIMENSION clause
    AUG-21-2008 12:14:49: ..... populating mapping info for the INHIERARCHY clause
    AUG-21-2008 12:14:49: ..... retrieving hierarchy information
    AUG-21-2008 12:14:49: ..... populating mapping info for the HIERARCHY and FAMILYREL clauses for hierarchy PRIM
    AUG-21-2008 12:14:49: ..... populating mapping info for the ATTRIBUTE clause
    AUG-21-2008 12:14:49: ... completed populating mapping for DIM_RISK_TYPE
    AUG-21-2008 12:14:49: ... generating limitmap for DIM_BOOK
    AUG-21-2008 12:14:49: ..... mapping table out of date for dimension DIM_BOOK. Updating mapping table.
    AUG-21-2008 12:14:49: ... populating dimension map for DIM_BOOK
    AUG-21-2008 12:14:49: ..... clearing mappings for the dimension
    AUG-21-2008 12:14:49: ..... retrieving physical objects
    AUG-21-2008 12:14:49: ..... checking for value hierarchies
    AUG-21-2008 12:14:49: ..... retrieving label for dimension levels
    AUG-21-2008 12:14:49: ..... populating mapping info for the DIMENSION clause
    AUG-21-2008 12:14:49: ..... populating mapping info for the INHIERARCHY clause
    AUG-21-2008 12:14:49: ..... retrieving hierarchy information
    AUG-21-2008 12:14:49: ..... populating mapping info for the HIERARCHY and FAMILYREL clauses for hierarchy PRIM
    AUG-21-2008 12:14:49: ..... populating mapping info for the ATTRIBUTE clause
    AUG-21-2008 12:14:50: ... completed populating mapping for DIM_BOOK
    AUG-21-2008 12:14:50: ... generating limitmap for DIM_CURVE
    AUG-21-2008 12:14:50: ..... mapping table out of date for dimension DIM_CURVE. Updating mapping table.
    AUG-21-2008 12:14:50: ... populating dimension map for DIM_CURVE
    AUG-21-2008 12:14:50: ..... clearing mappings for the dimension
    AUG-21-2008 12:14:50: ..... retrieving physical objects
    AUG-21-2008 12:14:50: ..... checking for value hierarchies
    AUG-21-2008 12:14:50: ..... retrieving label for dimension levels
    AUG-21-2008 12:14:50: ..... populating mapping info for the DIMENSION clause
    AUG-21-2008 12:14:50: ..... populating mapping info for the INHIERARCHY clause
    AUG-21-2008 12:14:50: ..... retrieving hierarchy information
    AUG-21-2008 12:14:50: ..... populating mapping info for the HIERARCHY and FAMILYREL clauses for hierarchy PRIM
    AUG-21-2008 12:14:50: ..... populating mapping info for the ATTRIBUTE clause
    AUG-21-2008 12:14:50: ... completed populating mapping for DIM_CURVE
    AUG-21-2008 12:14:50: ... generating limitmap for DIM_REFERENCE_ENTITY
    AUG-21-2008 12:14:50: ..... mapping table out of date for dimension DIM_REFERENCE_ENTITY. Updating mapping table.
    AUG-21-2008 12:14:50: ... populating dimension map for DIM_REFERENCE_ENTITY
    AUG-21-2008 12:14:50: ..... clearing mappings for the dimension
    AUG-21-2008 12:14:50: ..... retrieving physical objects
    AUG-21-2008 12:14:50: ..... checking for value hierarchies
    AUG-21-2008 12:14:50: ..... retrieving label for dimension levels
    AUG-21-2008 12:14:50: ..... populating mapping info for the DIMENSION clause
    AUG-21-2008 12:14:50: ..... populating mapping info for the INHIERARCHY clause
    AUG-21-2008 12:14:50: ..... retrieving hierarchy information
    AUG-21-2008 12:14:50: ..... populating mapping info for the HIERARCHY and FAMILYREL clauses for hierarchy PRIM
    AUG-21-2008 12:14:50: ..... populating mapping info for the ATTRIBUTE clause
    AUG-21-2008 12:14:51: ... completed populating mapping for DIM_REFERENCE_ENTITY
    AUG-21-2008 12:14:51: ... generating limitmap for DIM_POSITION
    AUG-21-2008 12:14:51: ..... mapping table out of date for dimension DIM_POSITION. Updating mapping table.
    AUG-21-2008 12:14:51: ... populating dimension map for DIM_POSITION
    AUG-21-2008 12:14:51: ..... clearing mappings for the dimension
    AUG-21-2008 12:14:51: ..... retrieving physical objects
    AUG-21-2008 12:14:51: ..... checking for value hierarchies
    AUG-21-2008 12:14:51: ..... retrieving label for dimension levels
    AUG-21-2008 12:14:51: ..... populating mapping info for the DIMENSION clause
    AUG-21-2008 12:14:51: ..... populating mapping info for the INHIERARCHY clause
    AUG-21-2008 12:14:51: ..... retrieving hierarchy information
    AUG-21-2008 12:14:51: ..... populating mapping info for the HIERARCHY and FAMILYREL clauses for hierarchy PRIM
    AUG-21-2008 12:14:51: ..... populating mapping info for the ATTRIBUTE clause
    AUG-21-2008 12:14:51: ... completed populating mapping for DIM_POSITION
    AUG-21-2008 12:14:51: ... completed generating limitmap for cube BI_NRDB_AGGR
    AUG-21-2008 12:14:51: ..... assigning limitmap to variable in the AW
    AUG-21-2008 12:14:51: ..... BI_NRDB_AGGR_CUBE_LIMITMAP found. Will update the variable
    AUG-21-2008 12:14:51: ..... defining view BI_DEMO.BI_NRDB_AGGR_CUBEVIEW over the cube
    AUG-21-2008 12:14:51: **
    AUG-21-2008 12:14:51: ** ERROR: View not created.
    AUG-21-2008 12:14:51: ** CAUSE: CREATE VIEW statement failed
    AUG-21-2008 12:14:51: ORA-36804: The OLAP_TABLE function encountered an error while parsing the LIMITMAP.
    AUG-21-2008 12:14:51: *** DEBUG INFORMATION ***
    AUG-21-2008 12:14:51: VIEW CREATION DDL ((truncated after 3900 characters)
    AUG-21-2008 12:14:51: CREATE OR REPLACE VIEW BI_DEMO.BI_NRDB_AGGR_CUBEVIEW AS
    SELECT *
    FROM table(OLAP_TABLE ('BI_DEMO.BI_NRDB duration session',
    '&(BI_NRDB_AGGR_CUBE_LIMITMAP)'))
    MODEL
    DIMENSION BY (
    DIM_BUSINESS_DAY,
    DIM_INSTRUMENT_TYPE,
    DIM_RISK_TYPE,
    DIM_BOOK,
    DIM_CURVE,
    DIM_REFERENCE_ENTITY,
    DIM_POSITION)
    MEASURES (
    DIM_BUSINE_PRIM_PRNT,
    DIM_BUSINE_ALL_BUSINE_LVLDSC,
    DIM_BUSINE_BUSINESS_D_LVLDSC,
    DIM_BUSINE_LDSC,
    DIM_BUSINE_LEVEL,
    DIM_INSTRU_PRIM_PRNT,
    DIM_INSTRU_ALL_INSTRU_LVLDSC,
    DIM_INSTRU_INSTRUMENT_LVLDSC,
    DIM_INSTRU_LDSC,
    DIM_INSTRU_LEVEL,
    DIM_RISK_T_PRIM_PRNT,
    DIM_RISK_T_ALL_RISK_T_LVLDSC,
    DIM_RISK_T_RISK_TYPE_LVLDSC,
    DIM_RISK_T_LDSC,
    DIM_RISK_T_LEVEL,
    DIM_BOOK_PRIM_PRNT,
    DIM_BOOK_ALL_BOOK_LVLDSC,
    DIM_BOOK_SYSTEM_LVLDSC,
    DIM_BOOK_REGION_LVLDSC,
    DIM_BOOK_BUSINESS2_LVLDSC,
    DIM_BOOK_BUSINESS1_LVLDSC,
    DIM_BOOK_BUSINESS_LVLDSC,
    DIM_BOOK_DESK_LVLDSC,
    DIM_BOOK_RISKSTRIPE_LVLDSC,
    DIM_BOOK_SUBRISKSTR_LVLDSC,
    DIM_BOOK_BOOK_LVLDSC,
    DIM_BOOK_TRADER,
    DIM_BOOK_LDSC,
    DIM_BOOK_LEVEL,
    DIM_CURVE_PRIM_PRNT,
    DIM_CURVE_ALL_CURVE_LVLDSC,
    DIM_CURVE_CURRENCY_LVLDSC,
    DIM_CURVE_SENIORITY_LVLDSC,
    DIM_CURVE_CURVE_OWNE_LVLDSC,
    DIM_CURVE_CURVE_NAME_LVLDSC,
    DIM_CURVE_CURVE_LVLDSC,
    DIM_CURVE_LDSC,
    DIM_CURVE_LEVEL,
    DIM_REFERE_ALL_GFN_LVLDSC,
    DIM_REFERE_GFN_INDUST_LVLDSC,
    DIM_REFERE_GFN_COUNTR_LVLDSC,
    DIM_REFERE_GFN_LVLDSC,
    DIM_REFERE_SPN_INDUST_LVLDSC,
    DIM_REFERE_SPN_COUNTR_LVLDSC,
    DIM_REFERE_SPN_LVLDSC,
    DIM_REFERE_LDSC,
    DIM_REFERE_SPN_SP_RATING,
    DIM_REFERE_SPN_MOODY_RATING,
    DIM_REFERE_LEVEL,
    DIM_REFERE_PRIM_PRNT,
    DIM_POSITI_PRIM_PRNT,
    DIM_POSITI_ALL_POSITI_LVLDSC,
    DIM_POSITI_TRADE_ID_LVLDSC,
    DIM_POSITI_COUPON,
    DIM_POSITI_MATURITY,
    DIM_POSITI_INSTRUMENT_NAME,
    DIM_POSITI_NOTIONAL,
    DIM_POSITI_BUYSELL,
    DIM_POSITI_CUSIP,
    DIM_POSITI_ISIN,
    DIM_POSITI_LDSC,
    DIM_POSITI_MTM,
    DIM_POSITI_LEVEL,
    TOTAL,
    AM_40Y,
    AM_30Y,
    AM_20Y,
    AM_15Y,
    AM_12Y,
    AM_10Y,
    AM_09Y,
    AM_08Y,
    AM_07Y,
    AM_06Y,
    AM_05Y,
    AM_04Y,
    AM_03Y,
    AM_02Y,
    AM_18M,
    AM_01Y,
    AM_09M,
    AM_06M,
    AM_03M,
    OLAP_CALC
    ) RULES UPDATE SEQUENTIAL ORDER()
    AUG-21-2008 12:14:51: LIMITMAP (truncated after 3900 characters):
    AUG-21-2008 12:14:51: DIMENSION DIM_BUSINESS_DAY FROM DIM_BUSINESS_DAY WITH -
    HIERARCHY DIM_BUSINE_PRIM_PRNT FROM DIM_BUSINESS_DAY_PARENTREL(DIM_BUSINESS_DAY_HIERLIST \'PRIM\') -
    INHIERARCHY DIM_BUSINESS_DAY_INHIER -
    FAMILYREL DIM_BUSINE_ALL_BUSINE_LVLDSC, -
    DIM_BUSINE_BUSINESS_D_LVLDSC -
    FROM DIM_BUSINESS_DAY_FAMILYREL(DIM_BUSINESS_DAY_LEVELLIST \'ALL_BUSINESS_DAY\'), -
    DIM_BUSINESS_DAY_FAMILYREL(DIM_BUSINESS_DAY_LEVELLIST \'BUSINESS_DAY\') -
    LABEL DIM_BUSINESS_DAY_LONG_DESCRIPTION -
    ATTRIBUTE DIM_BUSINE_LDSC FROM DIM_BUSINESS_DAY_LONG_DESCRIPTION -
    ATTRIBUTE DIM_BUSINE_LEVEL FROM DIM_BUSINESS_DAY_LEVELREL-
    DIMENSION DIM_INSTRUMENT_TYPE FROM DIM_INSTRUMENT_TYPE WITH -
    HIERARCHY DIM_INSTRU_PRIM_PRNT FROM DIM_INSTRUMENT_TYPE_PARENTREL(DIM_INSTRUMENT_TYPE_HIERLIST \'PRIM\') -
    INHIERARCHY DIM_INSTRUMENT_TYPE_INHIER -
    FAMILYREL DIM_INSTRU_ALL_INSTRU_LVLDSC, -
    DIM_INSTRU_INSTRUMENT_LVLDSC -
    FROM DIM_INSTRUMENT_TYPE_FAMILYREL(DIM_INSTRUMENT_TYPE_LEVELLIST \'ALL_INSTRUMENT_TYPE\'), -
    DIM_INSTRUMENT_TYPE_FAMILYREL(DIM_INSTRUMENT_TYPE_LEVELLIST \'INSTRUMENT_TYPE\') -
    LABEL DIM_INSTRUMENT_TYPE_LONG_DESCRIPTION -
    ATTRIBUTE DIM_INSTRU_LDSC FROM DIM_INSTRUMENT_TYPE_LONG_DESCRIPTION -
    ATTRIBUTE DIM_INSTRU_LEVEL FROM DIM_INSTRUMENT_TYPE_LEVELREL-
    DIMENSION DIM_RISK_TYPE FROM DIM_RISK_TYPE WITH -
    HIERARCHY DIM_RISK_T_PRIM_PRNT FROM DIM_RISK_TYPE_PARENTREL(DIM_RISK_TYPE_HIERLIST \'PRIM\') -
    INHIERARCHY DIM_RISK_TYPE_INHIER -
    FAMILYREL DIM_RISK_T_ALL_RISK_T_LVLDSC, -
    DIM_RISK_T_RISK_TYPE_LVLDSC -
    FROM DIM_RISK_TYPE_FAMILYREL(DIM_RISK_TYPE_LEVELLIST \'ALL_RISK_TYPE\'), -
    DIM_RISK_TYPE_FAMILYREL(DIM_RISK_TYPE_LEVELLIST \'RISK_TYPE\') -
    LABEL DIM_RISK_TYPE_LONG_DESCRIPTION -
    ATTRIBUTE DIM_RISK_T_LDSC FROM DIM_RISK_TYPE_LONG_DESCRIPTION -
    ATTRIBUTE DIM_RISK_T_LEVEL FROM DIM_RISK_TYPE_LEVELREL-
    DIMENSION DIM_BOOK FROM DIM_BOOK WITH -
    HIERARCHY DIM_BOOK_PRIM_PRNT FROM DIM_BOOK_PARENTREL(DIM_BOOK_HIERLIST \'PRIM\') -
    INHIERARCHY DIM_BOOK_INHIER -
    FAMILYREL DIM_BOOK_ALL_BOOK_LVLDSC, -
    DIM_BOOK_SYSTEM_LVLDSC, -
    DIM_BOOK_REGION_LVLDSC, -
    DIM_BOOK_BUSINESS2_LVLDSC, -
    DIM_BOOK_BUSINESS1_LVLDSC, -
    DIM_BOOK_BUSINESS_LVLDSC, -
    DIM_BOOK_DESK_LVLDSC, -
    DIM_BOOK_RISKSTRIPE_LVLDSC, -
    DIM_BOOK_SUBRISKSTR_LVLDSC, -
    DIM_BOOK_BOOK_LVLDSC -
    FROM DIM_BOOK_FAMILYREL(DIM_BOOK_LEVELLIST \'ALL_BOOK\'), -
    DIM_BOOK_FAMILYREL(DIM_BOOK_LEVELLIST \'SYSTEM\'), -
    DIM_BOOK_FAMILYREL(DIM_BOOK_LEVELLIST \'REGION\'), -
    DIM_BOOK_FAMILYREL(DIM_BOOK_LEVELLIST \'BUSINESS2\'), -
    DIM_BOOK_FAMILYREL(DIM_BOOK_LEVELLIST \'BUSINESS1\'), -
    DIM_BOOK_FAMILYREL(DIM_BOOK_LEVELLIST \'BUSINESS\'), -
    DIM_BOOK_FAMILYREL(DIM_BOOK_LEVELLIST \'DESK\'), -
    DIM_BOOK_FAMILYREL(DIM_BOOK_LEVELLIST \'RISKSTRIPE\'), -
    DIM_BOOK_FAMILYREL(DIM_BOOK_LEVELLIST \'SUBRISKSTRIPE\'), -
    DIM_BOOK_FAMILYREL(DIM_BOOK_LEVELLIST \'BOOK\') -
    LABEL DIM_BOOK_LONG_DESCRIPTION -
    ATTRIBUTE DIM_BOOK_TRADER FROM DIM_BOOK_TRADER -
    ATTRIBUTE DIM_BOOK_LDSC FROM DIM_BOOK_LONG_DESCRIPTION -
    ATTRIBUTE DIM_BOOK_LEVEL FROM DIM_BOOK_LEVELREL-
    DIMENSION DIM_CURVE FROM DIM_CURVE WITH -
    HIERARCHY DIM_CURVE_PRIM_PRNT FROM DIM_CURVE_PARENTREL(DIM_CURVE_HIERLIST \'PRIM\') -
    INHIERARCHY DIM_CURVE_INHIER -
    FAMILYREL DIM_CURVE_ALL_CURVE_LVLDSC, -
    DIM_CURVE_CURRENCY_LVLDSC, -
    DIM_CURVE_SENIORITY_LVLDSC, -
    DIM_CURVE_CURVE_OWNE_LVLDSC, -
    DIM_CURVE_CURVE_NAME_LVLDSC, -
    DIM_CURVE_CURVE_LVLDSC -
    FROM DIM_CURVE_FAMILYREL(DIM_CURVE_LEVELLIST \'ALL_CURVE\'), -
    DIM_CURVE_FAMILYREL(DIM_CURVE_LEVELLIST \'CURRENCY\'), -
    DIM_CURVE_FAMILYREL(DIM_CURVE_LEVELLIST \'SENIORITY\'), -
    DIM_CURVE_FAMILYREL(DIM_CURVE_LEVELLIST \'CURVE_OWNER\'), -
    DIM_CURVE_FAMILYREL(DIM_CURVE_LE
    AUG-21-2008 12:14:51: **
    AUG-21-2008 12:14:51: ** ERROR: Unable to create view over cube BI_NRDB_AGGR.
    AUG-21-2008 12:14:51: ORA-36804: The OLAP_TABLE function encountered an error while parsing the LIMITMAP.

  • Applying LIMIT (dimen.) TO TOP (...) BASEDON (...) structure in OLAP_TABLE

    Hi
    I'd like to know how to apply structure
    LIMIT dimension TO TOP (number of top member performers) BASEDON (measure)
    in OLAP_TABLE.
    For instance I have a cube SALES with 2 measures: SALES_VALUE and QUANTITY and a dimension PRODUCT with two levels: TOTAL and PRODUCT_NAME. Then I want to list 3 products with the highest SALES_VALUE and QUANTITY > 100.
    I can create for example such query:
    SELECT sales_val, quant, product_dsc
    FROM TABLE(OLAP_TABLE(
    'test_schema.test_aw DURATION SESSION',
    null,
    null,
    MEASURE sales_val FROM sales_value
    MEASURE quant FROM quantity
    DIMENSION product WITH
    HIERARCHY product_parentrel
    INHIERARCHY product_inhier
    ATTRIBUTE product_dsc FROM product_description
    ROW2CELL r2c'))
    WHERE
    OLAP_CONDITION(R2C, 'LIMIT product TO product_levelrel eq ''PRODUCT_NAME''', 1)=1
    AND OLAP_EXPRESSION_BOOL(R2C, ' quantity gt 100')=1
    AND OLAP_CONDITION(R2C, 'LIMIT product TO TOP 3 BASEDON sales_value, 1)=1;  ???????
    Instruction above does not work completely well, because it will give 3 rows with top values of SALES_VALUE measure, but in this case OLAP_CONDITION(R2C, 'LIMIT product TO product_levelrel eq ''PRODUCT_NAME''', 1)=1 is not fulfilled (row with values of TOTAL_PRODUCT level appears).
    One can create such query:
    SELECT sales_val, quant, product_dsc
    FROM TABLE(OLAP_TABLE(
    'test_schema.test_aw DURATION SESSION',
    null,
    *'LIMIT product TO TOP 3 BASEDON sales_value', ?????*
    MEASURE sales_val FROM sales_value
    MEASURE quant FROM quantity
    DIMENSION product WITH
    HIERARCHY product_parentrel
    INHIERARCHY product_inhier
    ATTRIBUTE product_dsc FROM product_description
    ROW2CELL r2c'))
    where
    OLAP_CONDITION(R2C, 'LIMIT product TO product_levelrel eq ''PRODUCT_NAME''', 1)=1
    AND OLAP_EXPRESSION_BOOL(R2C, ' quantity gt 100')=1;
    It leads to the same result as the first query.
    What shuold I do to make OLAP_CONDITION(R2C, 'LIMIT product TO product_levelrel eq ''PRODUCT_NAME''', 1)
    fulfill in query above?
    I can add that query below works as it should (LIMIT TO TOP... omitted).
    SELECT sales_val, quant, product_dsc
    FROM TABLE(OLAP_TABLE(
    'test_schema.test_aw DURATION SESSION',
    null,
    null,
    MEASURE sales_val FROM sales_value
    MEASURE quant FROM quantity
    DIMENSION product WITH
    HIERARCHY product_parentrel
    INHIERARCHY product_inhier
    ATTRIBUTE product_dsc FROM product_description
    ROW2CELL r2c'))
    WHERE
    OLAP_CONDITION(R2C, 'LIMIT product TO product_levelrel eq ''PRODUCT_NAME''', 1)=1
    AND OLAP_EXPRESSION_BOOL(R2C, ' quantity gt 100')=1;
    Thank you in advance for any help
    Peter

    Peter, Yes, I hadn't considered the condition sales_value greater than 100 in my mail.
    You can try either of the below limit cmds to include that condition too:
    limit product to limit(limit(limit(product to (product_levelrel eq 'PRODUCT_NAME') AND (sales_value gt 100)) keep top 3 basedon sales_value) sort top 3 basedon sales_value)
    -or-
    limit product to limit(limit(limit(limit(product to product_levelrel eq 'PRODUCT_NAME') keep sales_value gt 100) keep top 3 basedon sales_value) sort top 3 basedon sales_value)
    I dont think one can be sure that having separate olap_condition filters for each condition will work fine all the time. To simulate the cascading of AND operations of where clause (filters) in SQL, we can use the nested limit() function to act on progressively smaller/better qualified resultsets (cells). SQL query would apply the AND filters in any manner or order that the optimizer deems fit whereas using the limit function with keyword "keep" within it indicates an implicit order of filters. SQL query with multiple olap_conditions might rank and find top 3 -or- bottom 5 before it applies the filter "sales_value gt 100". In such a case, you may find that the query will return no rows or return only the top 1 or 2 out of top 3 which are gt 100 -or- in case of bottom, return no rows or return less than 5 members (only those above 100) -- not necessarily 3 "top 3" or 5 "bottom 5" members.
    rgds
    Shankar

  • Error when selecting from view created by OLAP_TABLE

    Hi all,
    I used OWB 10.2.0.4 to create a MOLAP datawarehouse.
    I created a view with this:
    CREATE OR REPLACE VIEW sales_view AS
    SELECT *
    FROM TABLE(OLAP_TABLE(
    'dw duration session',
    'MEASURE samt AS number(16,0) FROM SALES_SAMT
    DIMENSION cust_code AS varchar2(30) FROM cust
    DIMENSION prod_code AS varchar2(30) FROM prod
    DIMENSION sman_code AS varchar2(30) FROM sman
    DIMENSION time_id AS varchar2(30) FROM time
    DIMENSION orgn_code AS varchar2(30) FROM orgn'));
    and I try to run the following:
    select count(*) from sales_view;
    and I got the following error:
    Error starting at line 1 in command:
    select count(*) from sales_view
    Error report:
    SQL Error: ORA-29400: data cartridge error
    ORA-00600: internal error code, arguments: [xsvaluekeyget: type], [114], [], [], [], [], [], []
    29400. 00000 - "data cartridge error\n%s"
    *Cause:    An error has occurred in a data cartridge external procedure.
    This message will be followed by a second message giving
    more details about the data cartridge error.
    *Action:   See the data cartridge documentation
    for an explanation of the second error message.
    Can somebody give me some idea?
    Many thanks!
    - Andrew

    Brijesh,
    Really appreciate your help!
    With your hint (#2), I found my problems.
    I had 2 problems:
    1) I'm missing the 'Model' clause at the end of my view creation (in bold )
    2) I shouldn't do a count on all rows (e.g. I get result if I select with parameters)
    Here's my working view:
    CREATE OR REPLACE VIEW SALES_VIEW2
    AS
    SELECT * FROM TABLE(OLAP_TABLE(
    'DW DURATION SESSION',
    MEASURE SAMT FROM SALES_SAMT1
    DIMENSION PROD_CODE FROM PROD
    DIMENSION SMAN_CODE FROM SMAN
    DIMENSION TIME_CODE FROM TIME
    DIMENSION CUST_CODE FROM CUST
    DIMENSION ORGN_CODE FROM ORGN
    MODEL
    DIMENSION BY(PROD_CODE, CUST_CODE, SMAN_CODE, TIME_CODE, ORGN_CODE)
    MEASURES(SAMT)
    RULES UPDATE SEQUENTIAL ORDER();
    -----

  • Slow query using view on cube

    I have created a cube using Analytic workspace manager (oracle 10G R2) which is to be used (via a view) in OBIEE.
    One of the dimensions (event_dim) is extremely sparse (it has been marked as sparse and is at the appropriate level in the cube's dimensional hierarchy).
    In general, when I query the cube (via the view) at high levels of aggregation, the performance is good, but when I query the cube at the lowest level of granulrity for the event_dim dimension, the performance is extremely poor (more than a minute to return).
    The problem seems to be that the view is returning data for all possible rows in the cube even if most of the measures are NA (i.e null since there is no data present).
    For example if I run a query against the cube with no filter on the measures I get around 20,000 rows returned - obviously this takes a while. If I then put a 'my_measure > 0' clause on the query I get 2 rows back (which is correct). However this still takes more than a minute to return - I assume that this is because the query is having to process the 20,000 rows to find the two that actually have data.
    Is there any way to control this - I never need to see the NA data so would like to be able to disable this in either the cube or the view - and hence improve performance.
    Note: I cannot use the compression option since I need to be able to override the default aggregation plan for certain dimension/measure combinations and it appears that compression and overriding the plan are incompatible (AWM gives the error "Default Aggregation Plan for Cube is required when creating cube with the Compression option").
    Thanks,
    Chris

    I have seen this in some examples/mails. I havent tried it out myself :)
    Try using a OLAP_CONDITION filter with an appropriate entry point option (1) on the OLAP_TABLE based query and achieve the goal of restricting output from query to value with meas > 0. This condition can be added as part of a specific query or as part of the OLAP_TABLE view definition (applicable to all queries). Hopefully this way there is no need to customize the limitmap variable to suit the cube implementation internal details like compression, partitioning, presummarization, global composite etc.
    NOTE1: The olap_condition entry point 1 pushes the measure based dimension filter within the cube before fetching results from cube. Hopefully this will help speed up the retrieval of results. This should work well if we want the restriction to apply across 1 dimension.. Time or Product alone.. only 1 olap_condition is sufficient.
    SELECT ...
    FROM <olap_table_based_view>
    where ...
    and olap_condition(olap_calc, ' limit time KEEP sales_sales > 0', 1)=1
    --and olap_condition(olap_calc, ' limit time KEEP any(sales_sales, product) > 0', 1)=1
    NOTE2:
    For cases where both time and product (and more dimensions) need to be restricted then we can use 2 olap_conditions to restrict data to set of time and products where some data exists but you could still end up with a specific row (cross combination of product and time) with zero value. You may want to bolster the pre-fetch filtering by olap_condition via a regular sql filter referencing the external measure column (and sales_view_col >0) which is applied on to the results after it is fetched from the cube.
    E.g:
    SELECT ...
    FROM <olap_table_based_view>
    where ...
    and olap_condition(olap_calc, ' limit product KEEP any(sales_sales, time) > 0', 1)=1
    and olap_condition(olap_calc, ' limit time KEEP any(sales_sales, product) > 0', 1)=1
    and sales_view_col >0
    HTH
    Shankar

  • Different results when fetching using Datamaps vs. Limitmaps

    Hello,
    I'm currently using dbms_aw package to execute DML commands into AW's and using the OLAP_TABLE Function to access data. I'm encountering some unexepected behavior when trying to issue a "sort".
    Please consider the following:
    1. First I issue the command below and receive the following results:
    SQL> exec dbms_aw.execute('lmt Product to first 5;rpr w 100 PA.SHORTLABELF')
    PRODUCT PA.SHORTLABELF
    TOTALPROD Total Product
    FMGLC Gum Liq Ctr
    FMGLC24 Gum Liq Ctr 24s
    FMGLC24RP Gum Liq Ctr 24s RP
    FMMXS Mints X-S
    2. Next I sort the dimension values in status in ascending order by their shortlabel (simply a text variable dimensioned by my product dim.
    SQL> exec dbms_aw.execute('sort PRODUCT a PA.SHORTLABELF')
    PL/SQL procedure successfully completed.
    3. I looked at the results of the sort I get (as expected)
    SQL> exec dbms_aw.execute('rpr w 100 PA.SHORTLABELF')
    PRODUCT PA.SHORTLABELF
    FMGLC Gum Liq Ctr
    FMGLC24 Gum Liq Ctr 24s
    FMGLC24RP Gum Liq Ctr 24s RP
    FMMXS Mints X-S
    TOTALPROD Total Product
    4. Then I enter the following commmand using the OLAP_TABLE function and LimitMaps I receive the correct set of returned values however my sort has not been applied:
    SQL> SELECT * FROM TABLE(OLAP_TABLE('fmcalc DURATION SESSION','','',
    2 'MEASURE Time1 FROM PA.SHORTLABELF '))
    TIME1
    Total Product
    Gum Liq Ctr
    Gum Liq Ctr 24s
    Gum Liq Ctr 24s RP
    Mints X-S
    5. Finally, if I decide to go back and use datamaps in conjunction with the OLAP_TABLE function my sorting has "stuck"
    SQL> SELECT Text1 FROM TABLE(OLAP_TABLE('fmcalc DURATION SESSION','TempTable','fetch PA.SHORTLABELF', ''))
    Text1
    Gum Liq Ctr
    Gum Liq Ctr 24s
    Gum Liq Ctr 24s RP
    Mints X-S
    Total Product
    So, I guess the workaround to the using limitmaps is to use datamaps. My question is why does this behavior occur when using limitmaps and are there other scenrios where similiar behaviour might occur? My main reason is that during my development as a rule I have tried to use limitmaps.
    thanks
    brad

    Hi Brad,
    The short answer here is that SQL does not guarantee the order of rows unless it is explicitly sorted (at the SQL level). From that point of view, you could do something like
    exec dbms_aw.execute('lmt Product to first 5;rpr w 100 PA.SHORTLABELF')
    SELECT * FROM TABLE(OLAP_TABLE('fmcalc DURATION SESSION','','',
    2 'MEASURE Time1 FROM PA.SHORTLABELF ')) order by TIME1 ascending;
    (The reason this is happening is the code responsible for returning rows in the OLAP_TABLE limit map implementation is tuned to return data in the most efficient order.)
    I hope this helps,
    Ekrem

  • OLAP_TABLE, dimension

    Hi.
    I want to query my dimension using OLAP_TABLE, with no writing a complex code in OLAP_TABLE.
    What I need to write for it?
    My dimension have attribute name att1 (varchar2 30) and att2 (varchar2 100), but when i deploy dimension wia OWB is the name of the attribute the same (att1 att2)?
    I follow the instructions and made:
    CREATE TYPE row_obj AS OBJECT (
    att1 varchar2(30),
    att2 varchar2(100));
    CREATE TYPE table_obj AS TABLE OF row_obj;
    and I want now to do a select without creating a view:
    SELECT att1, att2[b]--is this correct, do I wrote here a name of dimension attribute?
    FROM TABLE(OLAP_TABLE(
    'my_aw_name duration session',
    'table_obj',
    'DIMENSION att1, att2 from my_dimension));--is this ok?
    When I try to run this select I recieve an error : att1 invalid identifier!!!
    Please help.
    Thanks.
    Message was edited by:
    deep222

    Keith, thanks for reply.
    But it seems that I have problem with view generator.
    I have installed install_olap_view_generator.sql, and first I maintain my molap dimesion via OWB.
    After I did that, I went to database I everything was ok, the aw$my_aw table was there. OWB was also created stage table for every level in dimension, and 2 views for it.
    Dimension name is MY_DIM and user that have this dimension MOLAP_USER.
    OLAP_VIEWS user is created before.
    But when try to create view for dimension I'll receieve this in dbms_output:
    error retrieving metadata for dimension MY_DIM
    you do not have access to the metadata in the AW
    view creation failed
    ORA-01403 NO DATA FOUND
    error defining limitmap
    ERROR: Unable to create view over dimension MY_DIM
    User-Defined_exception
    Was I something do wrong? I mean, olap_views user exist, script was executed witjout errors. Do i need to grant sometning to olap_views.
    Thanks.
    Deep
    Message was edited by:
    deep222

  • Can i access the Oracle Demand Planning Cubes using the AWM?

    Hi All,
    Is it possible to access the Oracle Demand planning data which is stored as Express server using the Analytic workspace manager?
    Any information regarding this is really appreciated.

    Abdul Hafeez,
    Is ODP using Express Server or Oracle OLAP Analytical workspaces?
    If Express Server is being used by ODP, then you cannot create sql views for OBIEE.
    If Oracle database is being used for ODP data, then it is storing the data in Analytical workspaces. In that case, you can manually create OLAP views using OLAP_TABLE function. To do that, you will first have to know all the required structures inside the Analytical workspaces. Without that knowledge, you will not know what olap structures to "expose" in the OLAP views.
    You can read about OLAP_TABLE function from Oracle 10g documentation http://download.oracle.com/docs/cd/B19306_01/olap.102/b14350/olap_table.htm
    If you are using 9i database for ODP, then read about OLAP_TABLE function from 9i documentation http://download.oracle.com/docs/cd/B10501_01/olap.920/a95295/olap_tab.htm
    - Nasar

Maybe you are looking for