Primary Key Data type in Time Dimension????

I have to create a Time dimension with day grain in a Datawarehouse system and I don’t know what is the best data type for the primary key...
For example
1) I could put Number(8) datatype, then the dates will be: 20050114, 20050115, 20050116.... Then in the fact tables I put the Number(8) datatype in the date fields... But in my reporting tools I have to put the to_date function to show the dates in the right format.
2) Or I could put Date datatype, then the dates will be: 01/14/2005, 01/15/2005, 01/16/2005.... Then in the fact tables I put the Date datatype in the date fields...
It’s the Date primary key a bad datatype? (Very slow)
What is the best Primary Key Data type in Time Dimension???
Thanks!

<quote>I have to create a Time dimension with day grain</quote>
OK.
<quote>But in my reporting tools I have to put the to_date function to show the dates in the right format</quote>
Why? ... if you’ve decided to have a Day dimension table what is stopping you from having the day represented as a DATE column in there? (plus all the other "right formats" you may need). The join keys should only be used for … joining.
<quote> It’s the Date primary key a bad datatype? (Very slow)</quote>
No … DATE or NUMBER won’t make any noticeable difference when used as the join key between the time dimension and the fact table.
Some see advantages in having the DATE FK in the fact table …
1. One can have range partitioning in the fact using real DATEs
2. One can get Day-derived info right from the fact table … that is, the join to the Day dimension is not needed
I don’t (see them as advantages) … for #1, range partitioning by some measure of time is still achievable as long as the PK values on the Day dimension are immutable (as they should) … and I don’t see #2 as an advantage for the DW end-users.
Personally, I prefer a surrogate numeric PK … but not things like 20050129.
<William>If you need dates then use dates. They are more robust, you can never accidentally have November 43rd</William>
Of course this can not be about the fact table … since there the column is constrained … so this is about accidentally getting "November 43rd, 2004" into the Day dimensions when the PK is numeric 20041143; true, but is a DATE PK more robust in this case? … No … one could accidentally insert to_date('29-Jan-2005','DD-Mon-YYYY') and to_date('29-Jan-2005 00:00:01','DD-Mon-YYYY HH24:MI:SS') and that won't be very good, would it? In both cases, one would need something extra to 100% protect the integrity of the Day dimension (mind you, loading the Day dimension probably happens once a year under the supervision of the most technical people on the project).
There is no best PK data type for the Day dimension (between NUMBER and DATE) … they are both workable solutions ... go with what you’re comfortable.

Similar Messages

  • How to defer the primary key validation to commit time

    Hi
    Is it possible to defer the primary key validation to commit time? I don't know why the framework checks for the unique key constraint immediately after inserting the row and before committing it. This causes "Too many objects match the primary key oracle.jbo.Key[null]" error if the user presses the create new record button multiple times before filling and saving the previous records.
    Thanks,
    Ferez

    Dear M.Jabr,
    Many thanks for your reply. I have access to the database but I prefer to use an ADF workaround to this problem rather than a DB workaround. I am not sure but I think that there should be a way to defer or disable primary key constraint in ADF.
    Anyway, I tried to make the primary key constraint DEFERRABLE in DB using PL/SQL developer but an error occurred (the name is used by another object) which I don't know why.
    Thanks,
    Ferez

  • Setting date ranges when Time dimension includes Period instead of Month

    I hope I am missing something simple here - we are on OBIEE 10g, and I have a Time dimension defined as follows:
    Year > Quarter > Period > Week > Day
    A "period" is not equivalent to a calendar month - a period can include either 4 or 5 weeks, and always starts on a Sunday. Fiscal years start on the first Sunday in July.
    I need to create a graph that shows Total Sales for the previous 13 periods (not including the current period). This needs to be a rolling 13 periods based on the current period.
    Since this is Period and not Month, I am unable to use the Month(CURRENT_DATE) functionality. Do I need to have repository variables defined for the current period? Is there another way to calculate what the current Period in my Time dimension is in a filter SQL?
    So I want to do something like "Where period between [current_period - 14] and [current_period -1] as the filter for Period.
    Thanks in advance for any assistance.
    Rhonda

    Sorry about that...
    Periods are 1-12 (numeric).
    Period 4 of FY 2012 for example has a begin date of 10/02/2011 and end date of 11/05/2011.
    Right now we do not have unique combos created (like 4/2012, 5/2012, etc) so to get a unique value I have to specify both a year and period.
    So on my dashboard today I will need to create a graph that covers FY2011 periods 6-12 and FY2012 periods 1-6 (translates to 12/5/2010 - 12/31/2011).
    I haven't created repository variables before, but as the Period parameter will be used often I guess I will find out how.
    Thanks in advance for the help.
    Rhonda

  • What is the data type for time and what to insert

    Hi there
    i had two attributes in a table called start_time and end_time and i want to insert time into these attrbutes e.g 10:00 and 11:00
    How do i do that
    what is oracle's built-in type for time???
    adn how do i insert values in the table(i.e the format)
    thanks

    There is not Oracle type that has just a time. The DATE and TIMESTAMP data types include both the date and the time (TIMESTAMP has millisecond resolution and has optional timezone support). If what you're really interested is a time interval (i.e. 1 hour), there are some INTERVAL data types.
    You have a lot of options for how to specify dates and timestamps along with format masks.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Primary Key Violation at the time of Moving from primary range to secondary range.

    Hi Experts,
    I've observed a strange issue in our environment.
    we are using sql server 2008 R2 with SP2.
    whenever a table is moving from primary range to secondary range on it's identity values, application is getting crashed with the message as below. 
    Violation of PRIMARY KEY constraint 'PK6'. Cannot insert duplicate key in object 'dbo.TD_TRANN'. The duplicate key value is (17868679).
    The statement has been terminated.
    OR
    Violation of UNIQUE KEY constraint 'IX_TDS_COST'. Cannot insert duplicate key in object 'dbo.TDS_COST'. The duplicate key value is (17, 19431201).
    identity ranges were auto managed by replication. agents are running continuous.
    please suggest.
    Cheers, Vinod Mallolu

    Well this is pretty simple, so there are two type of subscriptions (Server and client) in merge replication. So while adding article you provide following parameters:
    @pub_identity_range
    @identity_range
    You can check the details of above parameters on following article:http://msdn.microsoft.com/en-us/library/ms174329.aspx
    Snippet
     @pub_identity_range= ]
    pub_identity_range              
    Controls the identity range size allocated to a Subscriber with a server subscription when automatic identity range management is used. This identity range is reserved for a republishing Subscriber to allocate to its own Subscribers.
    pub_identity_range is bigint, with a default of NULL. You must specify this parameter if
    identityrangemanagementoption is auto or if
    auto_identity_range is true.
    [ @identity_range= ]
    identity_range              
    Controls the identity range size allocated both to the Publisher and to the Subscriber when automatic identity range management is used.
    identity_range is bigint, with a default of NULL. You must specify this parameter if
    identityrangemanagementoption is auto or if
    auto_identity_range is true.
    So for example you are adding "Server" type subscription then we consider @pub_identity_range value while assigning the range to that sub. If it is "Client" type subscription in that case we consider @identity_range value.
    You could run following query to check the range assigned to each publisher and subscriber:
    SELECT B.SUBSCRIBER_SERVER,B.DB_NAME,A.* FROM MSMERGE_IDENTITY_RANGE A,SYSMERGESUBSCRIPTIONS B
    WHERE A.SUBID=B.SUBID
    This should answer your other question as well.
    Vikas Rana | Please mark solved if I've answered your question, vote for it as helpful to help other user's find a solution quicker -------------------------------------------------------------------------------- This posting is provided "AS IS"
    with no warranties, and confers no rights. ------------------------------------------------

  • Question: to have different 2 key dates to show time-dep master data.

    Hello All -
    I would kindly like to ask your suggestion in this challenges.
    In our Finance report e.g AR Report, we have 2 Year to dates of Key Figures. 1) Current Year to date, and 2) previous Year to dates. We want to have the report shows time-dependent master data navigation attribute based on this 2 year to dates.
    I am thinking to have 2 Key Date selection parameter in the report e.g. 1) Current key-date, and 2) Previous Key-date
    The report above will show COLOR as per key date. If the posting is 'Previous YTD', the COLOR will show based on 'Previous Key Date', and if the posting for 'Current YTD', the COLOR will show based on 'Current Key-Date'.
    The question are:
    1) What to do for customization if we want to have 2 key dates in Query or Report? If you have experience it before, could you please share?
    2) If you think that there is other way, feel free to share it.
    Many Thanks, and really appreciate your suggestion & advice,
    Cheers,

    Hello Cornelia -
    Thanks for your advice:
    1) Use Info Set to temporal join between master data, and transaction.
    Comment:
    We are using multicube for reporting. Are you saying that we should put infoset into MultiCube?
    2) Modelling the time-dependent master data as a info object in transaction (Cube).
    Comment:
    Thanks for this, i will analyse if we go to this option.
    Btw, I am also thinking to use Virtual Characteristic, but the performance will be expensive, like using Info Set.
    Feel free for your comment,
    Is there any other backend door that we can use e.g. to use BADI Exit.
    Appreciate your feedback,
    Thanks,

  • Can't Deploy an EJB with primary key of Type BigDecimal to a WAS 6.20

    When using the DeployTool for the WAS 6.20, I get an error during creation of the archive, saying that the EJB's (CMP) primary key's class java.math.BigDecimal is not part of the JAR.
    Any idea what the mistake might be? any help is appreciated.
    Thx
    Michael

    Hello Howard,
    today I encountered the same problem.
    I'm writing an application with a couple of CMP EJB's in relation to each other, similar
    to the 'titan' sample application described by Richard Monson-Haefel - Enterpise JavaBeans.
    I followed exactly his description for using undefined primary keys (java.lang.Object)
    on page 291 (third edition).
    I'm still looking for the solution.
    I let you know if I find the reason for that.
    Regards
    Stephan

  • If enter any primary key data if this already in database it shows all data

    I want to make form for e.g i have table "customers" with column nammes like "name,id,address,things_bought,orders" when user enters the data like name which already in the datbase it shows all the table data on the form ? how it possible?
    for e.g user enters name allen which already in the database it shows all table data of name allen.
    naeem
    [email protected]

    use when-validate-item trigger to check whether record exists for name or not. if it is fetch record to store vaues into fields by simple select...into statement.

  • Better Primary Key

    What will make a better primary key? What is the best primary key Data type?

    If we're talking about synthetic primary keys, I'll agree with you, Andrew. Much easier to create a synthetic key using a NUMBER column.
    If we're talking about natural keys, though, I'm not so sure. If a VARCHAR2 column is truely the unique, immutable identifier for a row-- understanding the semantics of VARCHAR2 uniqueness, perhaps you really want case sensitivity-- I see no reason not to use that column as the primary key.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Efficiency of data type for surrogate keys

    Hi all
    In my fact table I have a foreign key of data type NUMBER and in my dimension I have a primary key of type NUMBER(12,0).
    In my understanding, these two columns are stored in the same way and there will be NO conversion that needs to take place when the database joins these two columns? My belief was that the 12,0 acted simply as a constraint. My DBA says otherwise though I am not convinced. Can someone please weigh in on this?
    Is it more efficient in any way at query time to have both columns declared as NUMBER?
    Thanks,
    Wrifster

    The above link does answer your question.
    "Oracle stores numeric data in variable-length format. Each value is stored in scientific notation, with 1 byte used to store the exponent and up to 20 bytes to store the mantissa. The resulting value is limited to 38 digits of precision. Oracle does not store leading and trailing zeros."
    So an integer will be stored the same in "number" as "number(12,0)
    You may also find this of use :- http://it.toolbox.com/blogs/oracle-guide/oracle-data-types-5-faqs-about-number-30525

  • Date time dimension solution

    I'd like to have a date and time dimension where i can drill down to hours and quarters. What i don't want is one large dimension ( too many rows :-). Getting a date and a time dimension linked from the fact table is another solution, but i don't know if i can drill down with this solution.
    My solution is creating a datetime dimension that is clustered with a date dimension and a time key and time table. What are the downgrades when i implement this? Probably creating a view wherein i join the cluster? And can i drill and create a single dimension using this implementation?

    I suspect that your chief problem is a forum mismatch
    ?

  • Automatic Creation of primary key at the time of creating entries

    Hi All,
    I have a requirement to generate the primary key automatically at the time of creating entries. I have managed to do so by writing an event code for the maintainance object in SE54.
    However called only when I create entries throught the Maintainance View.
    It does not get called when I write an insert statement in the program.
    Please suggest a way to achieve this.
    Thanks in advance,
    Archana.

    for assigning the primary key while using insert statement, write a piece of code to get the last pk value, increment it by 1 and then assign this value to the pk field of the next record while inserting. if you are using a fn mod to insert values, just have this piece of code right before the insert query. a better way would be to use a GUID which will be unique globally. there is a fn mod GUID_CREATE which you can use to generate GUID. i don't think there is a way to automate this while making entries using se11, unless you change the code that actually creates the entry in the database.

  • Primary key in Dimension

    Dear Colleague,
    We have SAP BPC 7.5 NW, SP10.
    In any dimension primary key is ID. So dimension members can't repeated with same ID.
    Our requrement is set our property RNN unique. We mean our dimension members can't repeated with same RNN.
    Is it possible in SAP BPC 7.5 NW. If no, could we solved it in BW side?
    Thanks,
    Kadraliyev Yerlan
    Edited by: Erlan Kadraliev on Feb 7, 2012 4:19 PM

    Dear Colleague
    Thanks for your answer Siva Namuduri .
    This solution can be usefull for us and at the moment we looking advantages and disadvantages.
    But do we have any other solution to make Property unique? Is it possible in BW side or FrontEnd(BPC)
    Thanks,
    Kadraliyev Yerlan

  • Setting up a TIME dimension in OBIEE

    Hi,
    We have an Oracle OLAP Cube built using AWM v10.2.0.3A. We have also created a relational view for this cube (using the OLAP view generator) and are now using this view as a data source in OBIEE v.10.1.3.3.2.
    As part of defining the Time dimension in the Business Model Layer of OBIEE repository, we have done all the relevant mappings to the TIME dimension as in the AWM Cube and have marked the dimension as type 'TIME'. Also, for the TIME logical table, we have defined each level (All Years, Year, Month, Quarter, and Day) to have its own chronological key with unique values at all levels. The primary key for our TIME table in the business layer is 'Day'. This level 'Day' is mapped to TIME_DAY_LVLDSC column of the relational view created over the AWM cube. The data type for this column is "VARCHAR". (We basically picked up all the 'Description' columns while creating the view over the cube!)
    With this background of the TIME dimension structure, here is the problem scenario:
    When we try to create a report with one AGO and one TODATE function defined over the "Day" level (both are defined as logical columns), then the report takes forever to run and never comes back with any data/error even for a handful of rows. We are seeking the forum's help on the following:
    1. Is it necessary for the primary key 'Day' of the TIME logical table to be of type DATE? If yes, does this mean that we have to change the column data type in our cube (or select a 'date' type column to be a part of the view and then redo the mapping in the repository) or do we just make a change to the column data type in the physical layer of OBIEE repository?
    2. Going by the description above, is there something missing (other than point 1. above) in the setup of the TIME dimension in OBIEE so as to make it usable for Time Series type of calculations/functions?
    Any help is much appreciated.
    Thanks and Regards,
    Piyush

    Hi Wildmight,
    Thanks a lot for your kind inputs.
    1. No, VARCHAR is fine. You should have also defined unique time keys in your time dimension (Quarter Year, Month Year) and check box 'time dimension' in the properties of your time dimension.
    -->> The Time dimension that we have defined in the Business layer of the repository is mapped to the respective level columns in the AWM cube and has already got unique members at each level. We are using the "Description (LVLDSC)" columns for each level and have defined the "Description" column to have unique values at each level. A sample data set looks like :
    Year:
    2007
    2008
    Quarter:
    QUARTER1 2007
    QUARTER2 2007
    QUARTER1 2008
    QUARTER2 2008
    Month:
    JANUARY 2007
    FEBRUARY 2007
    JANUARY 2008
    FEBRUARY 2008
    Day:
    Monday, January 1st 2007
    Tuesday, January 2nd 2007
    So in the above case, do we still need to define a unique key for each level like Quarter Year, Month Quarter, etc.? (Please note that the check box for 'TIME' dimension is checked !)
    2. Is your AGO based on TODATE? or your TODATE based on AGO?
    -->> I am not sure what this really means - however I can tell you that we have created two new logical columns (in the fact table in Business Layer) : one to show the measure as TODATE for Day level, and the other to show the measure as Day Ago.
    So it means that we are trying to create two reports with three columns as below:
    - Day     Measure on Day     Measure Todate (Day)
    - Day     Measure on Day     Measure Day Ago (Day, 1)
    I hope I have been able to clarify the problem scenario with this. Does this setup seem correct to you?
    Many thanks for your help.
    Best Regards,
    Piyush

  • OracleBI Spreadsheet Add-in Not Working With ROLAP TIME Dimension

    Hello,
    I've been trying to figure this bizarre behavior for a while now.
    I have created a TIME dimension (based on a relational table) using OEM and defined the metadata etc. My hierarchy has 4 levels: day->month->quarter->year. I have end_date and time_span attributes defined for each level. I have defined a simple cube dimensioned by TIME and having only 1 numeric measure.
    When I open BI Spreadsheet Add-in, I can see my cube measure and the dimension in the list of available entities. I add them to the list of selected entities and hit 'next'. On the next screen I arrange them to my liking and hit 'next' again. This is where the problem occurs. Or rather where nothing occurs. The add-in just gets stuck at this point and no matter what I do or click, it won't advance to the next step.
    If I change the dimension type from time to normal, then everything works as expected (although, I cannot do time-series analysis).
    If I create and enable an analytic workspace and use it in the add-in, then everything works as expected as well.
    Any ideas what's wrong here? I kind of suspect the end_date and time_span attributes are involved somehow...
    Thanks!
    Dobo

    The expected format for a relational time table would be something like the following:
    CREATE TABLE "BIBDEMO"."BIBDEMO_TIME"
    ("TIME_STD_MONTH" VARCHAR2(30),
    "TIME_STD_MONTH_LLABEL" VARCHAR2(60),
    "TIME_STD_MONTH_SLABEL" VARCHAR2(30),
    "TIME_STD_QUARTER" VARCHAR2(30),
    "TIME_STD_QUARTER_LLABEL" VARCHAR2(60),
    "TIME_STD_QUARTER_SLABEL" VARCHAR2(30),
    "TIME_STD_YEAR" VARCHAR2(30),
    "TIME_STD_YEAR_LLABEL" VARCHAR2(60),
    "TIME_STD_YEAR_SLABEL" VARCHAR2(30),
    "TIME_YTD_YEAR" VARCHAR2(30),
    "TIME_YTD_YEAR_LLABEL" VARCHAR2(60),
    "TIME_YTD_YEAR_SLABEL" VARCHAR2(30),
    CONSTRAINT BIBDEMO_TIME_PK PRIMARY KEY("TIME_STD_MONTH")
    ALTER TABLE "BIBDEMO"."BIBDEMO_TIME"
    ADD ("TIME_STD_MONTH_END_DATE" DATE,
    "TIME_STD_QUARTER_END_DATE" DATE,
    "TIME_STD_YEAR_END_DATE" DATE,
    "TIME_YTD_YEAR_END_DATE" DATE) ;
    ALTER TABLE "BIBDEMO"."BIBDEMO_TIME"
    ADD ("TIME_STD_MONTH_TIMESPAN" NUMBER,
    "TIME_STD_QUARTER_TIMESPAN" NUMBER,
    "TIME_STD_YEAR_TIMESPAN" NUMBER,
    "TIME_YTD_YEAR_TIMESPAN" NUMBER) ;
    and the metadata registration script should look something like this:
    -- This script modifies the bibdemo_time lookup table and bibdemo TIME dimension. It adds a period end date attribute.
    ALTER TABLE "BIBDEMO"."BIBDEMO_TIME"
    ADD ("TIME_STD_MONTH_END_DATE" DATE,
    "TIME_STD_QUARTER_END_DATE" DATE,
    "TIME_STD_YEAR_END_DATE" DATE,
    "TIME_YTD_YEAR_END_DATE" DATE) ;
    ALTER TABLE "BIBDEMO"."BIBDEMO_TIME"
    ADD ("TIME_STD_MONTH_TIMESPAN" NUMBER,
    "TIME_STD_QUARTER_TIMESPAN" NUMBER,
    "TIME_STD_YEAR_TIMESPAN" NUMBER,
    "TIME_YTD_YEAR_TIMESPAN" NUMBER) ;
    begin
    dbms_output.put_line('Drop level attributes of TIME prior to recreation.');
    cwm_olap_dim_attribute.remove_level_attribute('BIBDEMO', 'TIME', 'Long Description', 'L1', 'TIME_STD_YEAR_LLABEL');
    cwm_olap_dim_attribute.remove_level_attribute('BIBDEMO', 'TIME', 'Short Description', 'L1', 'TIME_STD_YEAR_SLABEL');
    cwm_olap_dim_attribute.remove_level_attribute('BIBDEMO', 'TIME', 'Long Description', 'L2', 'TIME_STD_QUARTER_LLABEL');
    cwm_olap_dim_attribute.remove_level_attribute('BIBDEMO', 'TIME', 'Short Description', 'L2', 'TIME_STD_QUARTER_SLABEL');
    cwm_olap_dim_attribute.remove_level_attribute('BIBDEMO', 'TIME', 'Long Description', 'L3', 'TIME_STD_MONTH_LLABEL');
    cwm_olap_dim_attribute.remove_level_attribute('BIBDEMO', 'TIME', 'Short Description', 'L3', 'TIME_STD_MONTH_SLABEL');
    cwm_olap_dim_attribute.remove_level_attribute('BIBDEMO', 'TIME', 'Long Description', 'L4', 'TIME_YTD_YEAR_LLABEL');
    cwm_olap_dim_attribute.remove_level_attribute('BIBDEMO', 'TIME', 'Short Description', 'L4', 'TIME_YTD_YEAR_SLABEL');
    commit;
    exception
    when others then
    dbms_output.put_line('ERROR: unexpected exception during seeding');
    cwm_utility.dump_error;
    rollback;
    raise;
    end;
    ALTER DIMENSION BIBDEMO.TIME
    DROP ATTRIBUTE L1
    DROP ATTRIBUTE L2
    DROP ATTRIBUTE L3
    DROP ATTRIBUTE L4;
    ALTER DIMENSION BIBDEMO.TIME
    ADD ATTRIBUTE L1 DETERMINES
    (BIBDEMO_TIME.TIME_STD_YEAR_LLABEL,
    BIBDEMO_TIME.TIME_STD_YEAR_SLABEL,
    BIBDEMO_TIME.TIME_STD_YEAR_END_DATE,
    BIBDEMO_TIME.TIME_STD_YEAR_TIMESPAN)
    ADD ATTRIBUTE L2 DETERMINES
    (BIBDEMO_TIME.TIME_STD_QUARTER_LLABEL,
    BIBDEMO_TIME.TIME_STD_QUARTER_SLABEL,
    BIBDEMO_TIME.TIME_STD_QUARTER_END_DATE,
    BIBDEMO_TIME.TIME_STD_QUARTER_TIMESPAN)
    ADD ATTRIBUTE L3 DETERMINES
    (BIBDEMO_TIME.TIME_STD_MONTH_LLABEL,
    BIBDEMO_TIME.TIME_STD_MONTH_SLABEL,
    BIBDEMO_TIME.TIME_STD_MONTH_END_DATE,
    BIBDEMO_TIME.TIME_STD_MONTH_TIMESPAN)
    ADD ATTRIBUTE L4 DETERMINES
    (BIBDEMO_TIME.TIME_YTD_YEAR_LLABEL,
    BIBDEMO_TIME.TIME_YTD_YEAR_SLABEL,
    BIBDEMO_TIME.TIME_YTD_YEAR_END_DATE,
    BIBDEMO_TIME.TIME_YTD_YEAR_TIMESPAN);
    declare
    timespan_desc_id number;
    enddate_desc_id number;
    TIME_DIM_ATTRIB_TYPE constant varchar2(30) := 'DIMENSION ATTRIBUTE';
    TIME_ATTRIBUTE_TYPE constant varchar2(30) := 'LEVEL ATTRIBUTE';
    begin
    dbms_output.put_line('Create end_date and timespan attributes of TIME for BIBDEMO schema');
    begin
    cwm_olap_level_attribute.set_name('BIBDEMO', 'TIME', 'L1', 'TIME_STD_YEAR_END_DATE', 'TIME_STD_YEAR_END_DATE');
    cwm_olap_level_attribute.set_name('BIBDEMO', 'TIME', 'L2', 'TIME_STD_QUARTER_END_DATE', 'TIME_STD_QUARTER_END_DATE');
    cwm_olap_level_attribute.set_name('BIBDEMO', 'TIME', 'L3', 'TIME_STD_MONTH_END_DATE', 'TIME_STD_MONTH_END_DATE');
    cwm_olap_level_attribute.set_name('BIBDEMO', 'TIME', 'L4', 'TIME_YTD_YEAR_END_DATE', 'TIME_YTD_YEAR_END_DATE');
    cwm_olap_level_attribute.set_name('BIBDEMO', 'TIME', 'L1', 'TIME_STD_YEAR_TIMESPAN', 'TIME_STD_YEAR_TIMESPAN');
    cwm_olap_level_attribute.set_name('BIBDEMO', 'TIME', 'L2', 'TIME_STD_QUARTER_TIMESPAN', 'TIME_STD_QUARTER_TIMESPAN');
    cwm_olap_level_attribute.set_name('BIBDEMO', 'TIME', 'L3', 'TIME_STD_MONTH_TIMESPAN', 'TIME_STD_MONTH_TIMESPAN');
    cwm_olap_level_attribute.set_name('BIBDEMO', 'TIME', 'L4', 'TIME_YTD_YEAR_TIMESPAN', 'TIME_YTD_YEAR_TIMESPAN');
    cwm_olap_dim_attribute.create_dimension_attribute('BIBDEMO', 'TIME', 'End_Date', 'End_Date', 'End Date of time period');
    cwm_olap_dim_attribute.create_dimension_attribute('BIBDEMO', 'TIME', 'Time_Span', 'Time_Span', 'Number of days in time period');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'Long Description', 'L1', 'TIME_STD_YEAR_LLABEL');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'Short Description', 'L1', 'TIME_STD_YEAR_SLABEL');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'End_Date', 'L1', 'TIME_STD_YEAR_END_DATE');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'Time_Span', 'L1', 'TIME_STD_YEAR_TIMESPAN');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'Long Description', 'L2', 'TIME_STD_QUARTER_LLABEL');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'Short Description', 'L2', 'TIME_STD_QUARTER_SLABEL');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'End_Date', 'L2', 'TIME_STD_QUARTER_END_DATE');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'Time_Span', 'L2', 'TIME_STD_QUARTER_TIMESPAN');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'Long Description', 'L3', 'TIME_STD_MONTH_LLABEL');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'Short Description', 'L3', 'TIME_STD_MONTH_SLABEL');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'End_Date', 'L3', 'TIME_STD_MONTH_END_DATE');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'Time_Span', 'L3', 'TIME_STD_MONTH_TIMESPAN');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'Long Description', 'L4', 'TIME_YTD_YEAR_LLABEL');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'Short Description', 'L4', 'TIME_YTD_YEAR_SLABEL');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'End_Date', 'L4', 'TIME_YTD_YEAR_END_DATE');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'Time_Span', 'L4', 'TIME_YTD_YEAR_TIMESPAN');
    begin
    SELECT descriptor_id INTO enddate_desc_id
    FROM all_olap_descriptors
    WHERE descriptor_value = 'End Date'
    AND descriptor_type = 'Time Dimension Attribute Type';
    begin
    dbms_output.put_line('Classify entity descriptor use end date for TIME');
    begin
    cwm_classify.add_entity_descriptor_use(enddate_desc_id, TIME_DIM_ATTRIB_TYPE, 'BIBDEMO', 'TIME', 'End_Date');
    exception
    when cwm_exceptions.element_already_exists
    then null;
    end;
    begin
    cwm_classify.add_entity_descriptor_use(enddate_desc_id, TIME_ATTRIBUTE_TYPE, 'BIBDEMO', 'TIME', 'L3', 'TIME_STD_MONTH_END_DATE');
    exception
    when cwm_exceptions.element_already_exists
    then null;
    end;
    begin
    cwm_classify.add_entity_descriptor_use(enddate_desc_id, TIME_ATTRIBUTE_TYPE, 'BIBDEMO', 'TIME', 'L2', 'TIME_STD_QUARTER_END_DATE');
    exception
    when cwm_exceptions.element_already_exists
    then null;
    end;
    begin
    cwm_classify.add_entity_descriptor_use(enddate_desc_id, TIME_ATTRIBUTE_TYPE, 'BIBDEMO', 'TIME', 'L1', 'TIME_STD_YEAR_END_DATE');
    exception
    when cwm_exceptions.element_already_exists
    then null;
    end;
    begin
    cwm_classify.add_entity_descriptor_use(enddate_desc_id, TIME_ATTRIBUTE_TYPE, 'BIBDEMO', 'TIME', 'L4', 'TIME_YTD_YEAR_END_DATE');
    exception
    when cwm_exceptions.element_already_exists
    then null;
    end;
    end;
    end;
    begin
    SELECT descriptor_id INTO timespan_desc_id
    FROM all_olap_descriptors
    WHERE descriptor_value = 'Time Span'
    AND descriptor_type = 'Time Dimension Attribute Type';
    begin
    dbms_output.put_line('Classify entity descriptor use time span for TIME');
    begin
    cwm_classify.add_entity_descriptor_use(timespan_desc_id, TIME_DIM_ATTRIB_TYPE, 'BIBDEMO', 'TIME', 'Time_Span');
    exception
    when cwm_exceptions.element_already_exists
    then null;
    end;
    begin
    cwm_classify.add_entity_descriptor_use(timespan_desc_id, TIME_ATTRIBUTE_TYPE, 'BIBDEMO', 'TIME', 'L3', 'TIME_STD_MONTH_TIMESPAN');
    exception
    when cwm_exceptions.element_already_exists
    then null;
    end;
    begin
    cwm_classify.add_entity_descriptor_use(timespan_desc_id, TIME_ATTRIBUTE_TYPE, 'BIBDEMO', 'TIME', 'L2', 'TIME_STD_QUARTER_TIMESPAN');
    exception
    when cwm_exceptions.element_already_exists
    then null;
    end;
    begin
    cwm_classify.add_entity_descriptor_use(timespan_desc_id, TIME_ATTRIBUTE_TYPE, 'BIBDEMO', 'TIME', 'L1', 'TIME_STD_YEAR_TIMESPAN');
    exception
    when cwm_exceptions.element_already_exists
    then null;
    end;
    begin
    cwm_classify.add_entity_descriptor_use(timespan_desc_id, TIME_ATTRIBUTE_TYPE, 'BIBDEMO', 'TIME', 'L4', 'TIME_YTD_YEAR_TIMESPAN');
    exception
    when cwm_exceptions.element_already_exists
    then null;
    end;
    end;
    end;
    end;
    commit;
    exception
    when others then
    dbms_output.put_line('ERROR: unexpected exception during seeding');
    cwm_utility.dump_error;
    rollback;
    raise;
    end;
    --UPDATE "BIBDEMO"."BIBDEMO_TIME" SET TIME_STD_MONTH_END_DATE = LAST_DAY(TO_DATE( time_std_month , 'monyy'));
    --UPDATE "BIBDEMO"."BIBDEMO_TIME" t SET TIME_STD_QUARTER_END_DATE = (select max(t1.time_std_month_end_date) from bibdemo_time t1 where t1.time_std_quarter = t.time_std_quarter group by t1.time_std_quarter) ;
    --UPDATE "BIBDEMO"."BIBDEMO_TIME" t SET TIME_STD_YEAR_END_DATE = (select max(t1.time_std_month_end_date) from bibdemo_time t1 where t1.time_std_year = t.time_std_year group by t1.time_std_year) ;
    update bibdemo_time set time_std_month_end_date = to_date('31-JAN-2000', 'dd-mon-yyyy') where time_std_month = 'JAN00';
    update bibdemo_time set time_std_month_end_date = to_date('29-FEB-2000', 'dd-mon-yyyy') where time_std_month = 'FEB00';
    update bibdemo_time set time_std_month_end_date = to_date('31-MAR-2000', 'dd-mon-yyyy') where time_std_month = 'MAR00';
    update bibdemo_time set time_std_month_end_date = to_date('30-APR-2000', 'dd-mon-yyyy') where time_std_month = 'APR00';
    update bibdemo_time set time_std_month_end_date = to_date('31-MAY-2000', 'dd-mon-yyyy') where time_std_month = 'MAY00';
    update bibdemo_time set time_std_month_end_date = to_date('30-JUN-2000', 'dd-mon-yyyy') where time_std_month = 'JUN00';
    update bibdemo_time set time_std_month_end_date = to_date('31-JUL-2000', 'dd-mon-yyyy') where time_std_month = 'JUL00';
    update bibdemo_time set time_std_month_end_date = to_date('31-AUG-2000', 'dd-mon-yyyy') where time_std_month = 'AUG00';
    update bibdemo_time set time_std_month_end_date = to_date('30-SEP-2000', 'dd-mon-yyyy') where time_std_month = 'SEP00';
    update bibdemo_time set time_std_month_end_date = to_date('31-OCT-2000', 'dd-mon-yyyy') where time_std_month = 'OCT00';
    update bibdemo_time set time_std_month_end_date = to_date('30-NOV-2000', 'dd-mon-yyyy') where time_std_month = 'NOV00';
    update bibdemo_time set time_std_month_end_date = to_date('31-DEC-2000', 'dd-mon-yyyy') where time_std_month = 'DEC00';
    update bibdemo_time set time_std_month_end_date = to_date('31-JAN-2001', 'dd-mon-yyyy') where time_std_month = 'JAN01';
    update bibdemo_time set time_std_month_end_date = to_date('28-FEB-2001', 'dd-mon-yyyy') where time_std_month = 'FEB01';
    update bibdemo_time set time_std_month_end_date = to_date('31-MAR-2001', 'dd-mon-yyyy') where time_std_month = 'MAR01';
    update bibdemo_time set time_std_month_end_date = to_date('30-APR-2001', 'dd-mon-yyyy') where time_std_month = 'APR01';
    update bibdemo_time set time_std_month_end_date = to_date('31-MAY-2001', 'dd-mon-yyyy') where time_std_month = 'MAY01';
    update bibdemo_time set time_std_quarter_end_date = to_date('30-JUN-2000', 'dd-mon-yyyy') where time_std_quarter = 'Q2.00';
    update bibdemo_time set time_std_quarter_end_date = to_date('30-SEP-2000', 'dd-mon-yyyy') where time_std_quarter = 'Q3.00';
    update bibdemo_time set time_std_quarter_end_date = to_date('31-DEC-2000', 'dd-mon-yyyy') where time_std_quarter = 'Q4.00';
    update bibdemo_time set time_std_quarter_end_date = to_date('31-MAR-2000', 'dd-mon-yyyy') where time_std_quarter = 'Q1.00';
    update bibdemo_time set time_std_quarter_end_date = to_date('31-MAR-2001', 'dd-mon-yyyy') where time_std_quarter = 'Q1.01';
    update bibdemo_time set time_std_quarter_end_date = to_date('31-MAY-2001', 'dd-mon-yyyy') where time_std_quarter = 'Q2.01';
    update bibdemo_time set time_std_year_end_date = to_date('31-DEC-2000', 'dd-mon-yyyy') where time_std_year = '2000';
    update bibdemo_time set time_std_year_end_date = to_date('31-MAY-2001', 'dd-mon-yyyy') where time_std_year = '2001';
    update bibdemo_time set time_ytd_year_end_date = to_date('31-DEC-2000', 'dd-mon-yyyy') where time_ytd_year = '2000';
    update bibdemo_time set time_ytd_year_end_date = to_date('31-MAY-2001', 'dd-mon-yyyy') where time_ytd_year = '2001';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 31 where "TIME_STD_MONTH" = 'JAN00';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 29 where "TIME_STD_MONTH" = 'FEB00';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 31 where "TIME_STD_MONTH" = 'MAR00';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 30 where "TIME_STD_MONTH" = 'APR00';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 31 where "TIME_STD_MONTH" = 'MAY00';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 30 where "TIME_STD_MONTH" = 'JUN00';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 31 where "TIME_STD_MONTH" = 'JUL00';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 31 where "TIME_STD_MONTH" = 'AUG00';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 30 where "TIME_STD_MONTH" = 'SEP00';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 31 where "TIME_STD_MONTH" = 'OCT00';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 30 where "TIME_STD_MONTH" = 'NOV00';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 31 where "TIME_STD_MONTH" = 'DEC00';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 31 where "TIME_STD_MONTH" = 'JAN01';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 28 where "TIME_STD_MONTH" = 'FEB01';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 31 where "TIME_STD_MONTH" = 'MAR01';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 30 where "TIME_STD_MONTH" = 'APR01';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 31 where "TIME_STD_MONTH" = 'MAY01';
    update "BIBDEMO"."BIBDEMO_TIME" t
    set "TIME_STD_QUARTER_TIMESPAN" = (
    select sum(t1.time_std_month_timespan)
    from bibdemo_time t1
    where t."TIME_STD_QUARTER" = t1.time_std_quarter
    group by t1.time_std_quarter
    update "BIBDEMO"."BIBDEMO_TIME" t
    set "TIME_STD_YEAR_TIMESPAN" = (
    select sum(t1.time_std_month_timespan)
    from bibdemo_time t1
    where t."TIME_STD_YEAR" = t1.time_std_year
    group by t1.time_std_year
    update "BIBDEMO"."BIBDEMO_TIME" t
    set "TIME_YTD_YEAR_TIMESPAN" = (
    select sum(t1.time_std_month_timespan)
    from bibdemo_time t1
    where t."TIME_YTD_YEAR" = t1.time_ytd_year
    group by t1.time_ytd_year
    commit;
    quit;
    Hope this helps
    Business Intelligence Beans Product Management Team
    Oracle Corporation

Maybe you are looking for

  • Choosing an external hard drive for back up

    This is more for general advice than a specific question. Right now I have my hard drive partitioned and use the second as a backup with Time Machine. It will work for most situations but not all, such as a home fire or break-in (all my photos and mu

  • ERROR upload: Error in uploadXMLFiles after upgrading from 10.2.0.4

    After upgrading from 10.2.0.1 to 10.2.0.4 on a newly installed Oracle server, I could not use dbconsole any more. It would not display the login page at http://myserver:1158/em. I tried different browser IE, FireFox, and Chrome. It is the same. Then

  • I phone problems sending lots of texts

    Hi there, I am tearing my hair out because I need to send a text message to a large group (not a group text where everyone else gets all the replies) and once i have spent ages selecting each member it then wont send. SMS is on in settings imessage i

  • Oracle 9i on Win ME

    Does Oracle 9i supports Win ME. If not, when will it be available . Can this be done in Win ME, to operate 9i. Open c:\windows\win.ini, search for [Compatibility95] and add the line Jrew=0x00080000 Thanks, Manish.

  • Is it possible to stop the same swf button file from having to reload on different html pages

    Please view my website below. Any help would be appreciated. Each time you go to another page the buttons flash white while having to reload. Is there any way around this? http://www.kineticcreativeco.com/