Hierarchy in oracle

Dear expert
After so much digging around and studying I have been able to make some progress in understanding and utilizing hierarchy structures in oracle but I am not there unfortunately. I have the following sample data below
create table t1
  parent_id varchar2(200),
  child_id varchar2(200)
insert into t1
  (parent_id, child_id)
values
  ('P1', 'C1');
insert into t1
  (parent_id, child_id)
values
  ('P2', 'C2');
insert into t1
  (parent_id, child_id)
values
  ('C1', 'D1');
insert into t1
  (parent_id, child_id)
values
  ('D1', 'D2');
  insert into t1
  (parent_id, child_id)
values
  ('D1', 'D3');I can use this query below to get a parents child assuming it has only one child
select t.child_id
from t1 t
start with t.parent_id = 'D1'
connect by prior t.parent_id = t.child_id;but when if the parent has two children it crashes and returns so many unwanted info...Can any one help with that.
which is meant to get a child associated parents all the way to the last parent but it is not working.
Overall this is the output I want for D1
Child Path
D1 D1->C1->P1
also I should have an opportunity depending on the parameter to stop on one level if possible,
All help is appreciated. Thank you

Hi,
Thanks for posting the CREATE TABLE and INSERT statements; that really helps!
Don't forget to say which version of Oracle you're using. This is especially important with CONNECT BY queries, since every version since Oracle 7 has had significant improvements in this area. The queries below work in Oracle 10.1 (and up).
Here's one way:
SELECT     CONNECT_BY_ROOT     child_id          AS child
,     SYS_CONNECT_BY_PATH (parent_id, ' -> ')     AS path
FROM     t1
WHERE     CONNECT_BY_ISLEAF     = 1
START WITH     child_id     = 'D1'
CONNECT BY     child_id     = PRIOR parent_id
;or, if you really want 'D1' in the path:
WITH     got_root   AS
     SELECT     CONNECT_BY_ROOT     child_id          AS child
     ,     SYS_CONNECT_BY_PATH (parent_id, ' -> ')     AS path
     FROM     t1
     WHERE     CONNECT_BY_ISLEAF     = 1
     START WITH     child_id     = 'D1'
     CONNECT BY     child_id     = PRIOR parent_id
SELECT     child
,     child || path     AS path
FROM     got_root
;Output:
CHILD      PATH
D1         D1 -> C1 -> P1Unfortunately, you can't always use CONNECT_BY_ROOT in place of any other expression. In this case, an ORA-00932 error occurs if you try to do the || operation in the CONNECT BY query, but you can do it in a separate query.
user13328581 wrote:
... also I should have an opportunity depending on the parameter to stop on one level if possible,Sorry, I don't understand. Post the exact output you want, formatted, between \ tags.
You can include conditions like "AND LEVEL <= n" in the CONNECT BY clause.  If n=1, it might be bettter just to do a self-join, rather than CONNECT BY.
Edited by: Frank Kulash on May 13, 2011 10:31 AM
Corrected spelling                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Handling hierarchy in oracle sql query

    I have two tables:
    The first contains COMPANY_ID and CATEGORY_ID
    The second contains CATEGORY_ID and PARENT_CATEGORY_ID
    I need to return a list containing COMPANY_ID and CATEGORY_ID. The entries, however, must come not only from the first table, but also include all the descendants listed in the second table.
    So for example (and please read the example carefully) - let’s say in the first table I have one row:
    COMPANY_ID | CATEGORY_ID
    1000 | 1
    In the second table, I have three rows:
    CATEGORY_ID | PARENT_CATEGORY_ID
    1 | null
    2 | 1
    3 | 2
    4 | null
    I want to have the following rows as a result:
    COMPANY_ID | CATEGORY_ID
    1000 | 1
    1000 | 2
    1000 | 3
    How can I do this in oracle 10 in a single SQL statement ?

    Hi,
    Welcome to the forum!
    Whenver you have a question, post your sample data in a form that people can use.
    CREATE TABLE and INSERT statements are great:
    CREATE TABLE  first
    (       company_id     NUMBER (4)
    ,     category_id     NUMBER (4)
    INSERT INTO first (company_id, category_id) VALUES (1000,   1);CREATE TABLE AS is good, too:
    CREATE TABLE  second
    AS
    SELECT     1 AS category_id, NULL AS parent_category_id     FROM dual     UNION ALL
    SELECT     2,               1                          FROM dual     UNION ALL
    SELECT     3,               2                          FROM dual     UNION ALL
    SELECT     4,               NULL                    FROM dual;Without that, people can't test their ideas, and are often unsure about your data.
    You should also say what version of Oracle you're using. That's especially important with CONNECT BY queries. Every version since Oracle 7 has had significant improvements in how to do CONNECT BY queries. The query below works in Oracle 10 (and up).
    For hierarchies and trees, use CONNECT BY
    When you have to join tables and use CONNECT BY, it's usually more efficient to do one in a sub-query, and the other in another query.
    In the example below, we're doing the CONNECT BY in sub-query cbq, and the join in the main query.
    WITH     cbq     AS
         SELECT     category_id
         ,     CONNECT_BY_ROOT category_id     AS root_category_id
         FROM     second
         START WITH     parent_category_id     IS NULL
               AND     category_id          IN ( SELECT  category_id          -- Maybe; see note below
                                             FROM    first
         CONNECT BY     parent_category_id     = PRIOR category_id
    SELECT  first.company_id
    ,     cbq.category_id
    FROM     first
    JOIN     cbq     ON     first.category_id     = cbq.root_category_id
    ;The 2nd condition in the START WITH clause won't change the results any; any rows that are excluded by that condition would also be excluded by the join condition. There can be a big differenece in performance, however. Try the query both ways, and use the 2nd condition if it helps.
    Edited by: Frank Kulash on Feb 3, 2010 3:46 PM

  • Creating Hierarchy programmatically Oracle express

    Hi
    I am working on a BI project where the data including dimensions should be populated from oracle8i. I want to know how do i create dimensions and their hierarchies programmatically, coz i will always have to update the dimensions depending upon the updation of oracle8i. I am really confused about it.
    can anyone help me out..
    thanks

    Hi,
    You are trying to fetch data from relational database to express database and want to write some program for it. i suggest here to use RAA tool to do this work. this is flexible and very good tool for HOLAP kind of situation.
    hope it will give you some clue.
    Thanks,
    Hamendra

  • Need Expert Advice regarding oracle and java objects

    In our project, we are submitting data for many screens at a time. Some screens will have a list of records to be submitted. There is also some hierarchy among the data up to 4 levels.
    In such a scenario, we need to know the best way to exchange data between Oracle and Java. Currently java holds the data as objects, where each object may contain an array of next level of objects in it.
    Is it best approach to pass the entire data with hierarchy to Oracle using nested table approach and internally oracle handling the data? Is there any other way to do this?
    Also in some scenarios we need to pass the entire information for all the screens in one shot with the hierarchy. So we need to know a solution for that also. Could you please help us in this regard?

    See Oracle JPublisher technique to map Oracle object types to Java ones:
    http://download-west.oracle.com/docs/cd/B10501_01/java.920/a96658/toc.htm
    Rgds

  • Problem with drill down on hierarchy with data on diffrent levels

    Hello,
    Im working on a project using oracle bi 10.1.3.4.1, and im kinda stuck with some problems.
    I have a transaction table in which i have data about products, something like :
    prod_id
    amount1
    amount2
    and a product hierarchy which is something like:
    prod_id
    prod_name
    parent_id
    since bi doesnt support hierarchies, i had to faltten the hier table to somehing like this:
    prod_id
    lvl1_prod_id
    lvl2_prod_id
    lvl3_prod_id
    lvl4_prod_id
    and use this as my hierarchy in oracle bi. thus when i drill to lvl3, it will find all the products which are decendents of lvl3 value and group them.
    the problem is, that the hier tree is not even, one product data (in transaction table) can be for lvl4 and another for lvl2. so for a lvl2 product id's in level 3 and 4 will be null.
    when i try to drill to lvl 4, it takes all the rows which have the selected value in column lvl4 and group them, and if lvl 4 is null, it would sum up all the rows that have no parent at lvl4...
    i hope you understand... cause it is a bit complicated..
    anyway i would eventually like to add a filter of != null to the column being drilled down.
    but how do i know which column is it?
    i cant add a != null filter to all the columns since most if not all of them will have null in some lvl (lvl 10 or so).
    one suggested solution was to make a report for each lvl with the !=null filter on the report lvl, and use navigate instead of drilldown... but that would mean i have to make 10 reports for each "real" report... a big problem to maintain.
    hope i was clear enough, any suggestions?
    thanks a lot!

    Hi Ingo,
    Thanks for your reply. If I combine two objects in one objects then I cannot use that object for drill down in my report.
    I want to drill down for both Key and Text.

  • Parent-child hierarchy (Value based hierarchy)

    As anyone created a parent-child hierarchy using Oracle Warehouse Builder or Analytic Workspace Manager. I am using Oracle 10g Rel2 (and AWM) and OWB 10g Rel2.
    The values in the dimension table defines the hierarchy.
    I don't see an option of creating a value-based hierarchy in OWB though it is mentioned that it supports this particular hierarchy.
    In AWM, I am able to create the hierarchy but when I try to view the data in the dimension it gives an error BIB-9531 Invalid hierarchy specified.
    Can you please let me know if I am missing something.
    Thanks a lot in advance!
    Regards,
    Maruthi

    I've done some work with this, and it hasn't been easy going. There is no built-in ability to form a hierarchy of measure columns, at least nothing that can be predefined as the drill for a fact column. For example: I have 220 details of expense that have an exact arrangement with 5 levels and subtotals. Besides the expense detail there are say 4 dimensions, so the expense detail would be the 5th dimension. I have both arrangements in my rpd: 4D and 5D. They can be used together or separately. The 4D basically has 1000's of measures and there is no relationship between them besides the display arrangement in Answers. The 5D has a 5 column dimension that can drill the expense column from Total_Expense down to the 220 rows of detail expense.

  • Hierarchy problems

    Hi,
    I made a hierarchy on oracle forms 9i and if I want to add more columns I get
    the error frm-47321: data used to populate tree is invalid.
    my record grup looks (when it works correct):
    select 1, level, g.grup_cod, to_char(g.valoare), g.den_grup
    from grup_obiectiv g
    join contract c on g.contract_id = c.contract_id
    start with g.parent_grup is null
    connect by prior g.grup_id = g.parent_grup_id
    and when i bring one more column I get the above error
    can someone help me ?
    Thank you

    Hi,
    As Andreas mentioned, the query for the Hierarchical Tree should be adhering to the standard set of columns.
    Basically, the query for htree contains 5 parts (columns)
    1. Initial state
    2. Depth (of the tree node)
    3. Label (of the tree node)
    4. Icon (of the tree node)
    5. Data (i.e actual return value of the node, that would be passed back upon selection).
    So, if you want to have multiple values to be displayed, you might want to put them together under Label (concatenated).
    I.e you can modify your query like
    select -1, level, last_name ||', ' || first_name || ' : ' || hire_date ||' : '  || 
                           email || ' : ' ||job_id || ' : ' ||
                           salary || ' : ' || salary*1.5  label,
                  null, empno from emp
    start with ......-Arun

  • About using categories and perspectives for new user

    We are just beginning a conversion and upgrade project to convert our Web site to Oracle Portal. I'm trying to get a good handle on some different things we need to resolve as part of the project. One of the first decisions is using Categories and Perspectives.
    I'd like to ask users about how they have used categories and perspectives and some real-world examples of how these work and improve the site and user experience.
    About us
    We're a big nonprofit river authority and wholesale electric provider in Austin, Texas. Currently, we offer very limited online transaction capabilities. However, we are diverse organization and users come to us looking for every specific information, so these elements may be very helpful. I'm evaluating how we can use these and other elements to make recommendations. Some real-world examples and best practices would help a lot.
    Thank you, Charles Boisseau
    Web editor
    Lower Colorado River Authority
    [email protected]

    Continuing the thread...
    Perspectives and categories may be leveraged in custom search portlets, so that you can enter the content one time, in one place, and have selected content display in multiple places.
    Re: our "news" concept: our central communications group posts news stories tagged with one or more perspectives, such as which school is related to the story. This allows us to keep all of our news stories in one page group, but reuse the content elsewhere. For example, for the School of Nursing intranet, we can use a custom search portlet that automatically displays only that school's stories.
    You'll want to do some up-front planning regarding your classification scheme. One significant limitation of both categories and perspectives is the inability to change the hierarchy. Oracle Portal product team, if you're reading this, this is a serious pain! I might also recommend leaving your classification scheme relatively flat. Tagging content with perspectives becomes more difficult if the content contributor has to visually traverse a deep hierarchy of perspectives.
    Categories work similarly, but we mainly use them to visually sort items on a page using the "Group By" feature of a region.
    Hope this gets some gears turning.
    -John

  • ADF from JDeveloper 10.1.2 not compatible with iAS 9.0.1

    Hi,
    We developed an ADF Application with JDeveloper 10.1.2 and we use the ADF interMedia domains (e.g. oracle.ord.im.OrdDocDomain). The application runs fine in JDeveloper, but doesn't run on our iAS 9.0.4.1. We get the following exception:
    java.lang.NoClassDefFoundError: oracle/sql/DatumWithConnection
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:219)
    at oracle.jbo.common.java2.JDK2ClassLoader.loadClassForName(JDK2ClassLoader.java:38)
    at oracle.jbo.common.JBOClass.forName(JBOClass.java:161)
    at oracle.jbo.common.JBOClass.findDataClass(JBOClass.java:203)
    at oracle.jbo.server.AttributeDefImpl.initFromXML(AttributeDefImpl.java:2061)
    at oracle.jbo.server.AttributeDefImpl.loadFromXML(AttributeDefImpl.java:2013)
    at oracle.jbo.server.EntityDefImpl.loadAttribute(EntityDefImpl.java:2815)
    at oracle.jbo.server.EntityDefImpl.loadAttributes(EntityDefImpl.java:2779)
    at oracle.jbo.server.EntityDefImpl.loadFromXML(EntityDefImpl.java:2362)
    at oracle.jbo.server.EntityDefImpl.loadFromXML(EntityDefImpl.java:2106)
    at oracle.jbo.server.MetaObjectManager.loadFromXML(MetaObjectManager.java:514)
    [...rest of stacktrace omitted ...]
    The problem is that the JDBC version of the iAS 9.0.4.1 is missing the class DatumWithConnection that is indirectly referenced by the interMedia classes supplied with JDeveloper 10.1.2.
    In detail, oracle.ord.im.OrdDoc uses oracle.sql.STRUCT. The inheritance hierarchy of STRUCT is different in the JDBC versions on iAS 9.0.4.1 (oracle.sql.Datum <- oracle.sql.STRUCT) and JDeveloper 10.1.2 (oracle.sql.Datum <- oracle.sql.DatumWithConnection <- oracle.sql.STRUCT). The class file of oracle.ord.im.OrdDoc (from 10.1.2. JDeveloper) was apparently compiled the new JDBC driver version since it contains a reference to oracle.sql.DatumWithConnection. And that class cannot be found if run on iAS 9.0.4.1 with its old JDBC version.
    I think this is a very serious problem, since it means that ADF from JDeveloper 10.1.2 is not compatible with iAS 9.0.4.1, in contradiction to the support matrix (http://www.oracle.com/technology/products/jdev/collateral/papers/10g/as_supportmatrix.html).
    Upgrading the JDBC Driver on the iAS seems to be the only clean solution for this problem (we also tried using old versions of the ordim.jar etc. but that always leads to other problems). But simply exchanging the JDBC jar-files on the server breaks the Enterprise Manager on our iAS installation.
    I have two questions:
    1) Is there a recommended workaround for the compatibility issue described above?
    2) Is there a documented and supported way to upgrade the JDBC driver of iAS 9.0.4.1? I searched OTN and MetaLink and haven't found anything about this.
    Kind Regards,
    Kay
    P.S. It is surprising that this problem is rarely mentioned in the OTN forums at all. The only relevant thread is on the JHeadstart Forum:
    JHeadstart Deployment Issue
    P.S.2
    More info on what we tested:
    We have thoroughly checked that the 10.1.2. ADF runtime was correctly deployed on our iAS 9.0.4.1. We installed a OC4J 9.0.4.0.0 standalone on the same linux machine as our iAS 9.0.4.1 and deployed our application on it, getting the same error (java.lang.NoClassDefFoundError: oracle/sql/DatumWithConnection) as on the iAS. Replacing the JDBC drivers of the OC4J standalone with the version that came with JDeveloper 10.1.2 solved the problem.

    I don't think that mixing classes from different jar file is a good idea. Nevertheless, we tested this approach already. Adding the DatumWithConnection.class from the 10.1.0.3.0 JDBC version to the jar file of the original JDBC version (of the iAS 9.0.4.1.0) caused a java.lang.VerifyError to appear.
    The DatumWithConnection class is not simply added in the newer JDBC version. It is inserted into the inheritance hierarchy of oracle.sql.STRUCT and oracle.sql.Datum. Simply providing the new class next to the old JDBC driver will not work.
    To give more information about what's wrong with updating the complete JDBC driver, I justed tested it again. To update the JDBC driver I stopped the server, changed the contents of jdbc/lib, started the server. I tried it with JDBC Version 9.2.0.5 as well as 10.1.0.3.0.
    In both cases, our own application works, i.e. no more NoClassDefFoundError caused by oracle.sql.DatumWithConnection.
    The Enterprise Manager shows strange behaviour, however. Some features work as usual but, for example, when I click on the "Applications" tab for our OC4J instance, we just get the following error shown in the browser:
    An error was encountered while loading page. Failed to initialize configuration management user session.. See base exception for details.
    Root Cause: TDU
    Resolution: See base exception for details.. TDU
    In one of the server logs I found the following stacktrace:
    java.lang.NoSuchFieldError: TDU
         at oracle.net.resolver.NavDescription.navigate(Unknown Source)
         at oracle.net.resolver.NavServiceAlias.navigate(Unknown Source)
         at oracle.net.resolver.AddrResolution.resolveAddrTree(Unknown Source)
         at oracle.net.resolver.AddrResolution.resolveAndExecute(Unknown Source)
         at oracle.net.ns.NSProtocol.establishConnection(Unknown Source)
         at oracle.net.ns.NSProtocol.connect(Unknown Source)
         at oracle.jdbc.ttc7.TTC7Protocol.connect(TTC7Protocol.java:1777)
         at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:215)
         at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:365)
         at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:547)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:347)
         at java.sql.DriverManager.getConnection(DriverManager.java:512)
         at java.sql.DriverManager.getConnection(DriverManager.java:171)
         at oracle.context.isearch.admin.users.InstanceManager.getSchemaConnection(InstanceManager.java:688)
         at test.admin__status._jspService(_admin__status.java:112)
         at com.orionserver[Oracle Application Server Containers for J2EE 10g (9.0.4.1.0)].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:349)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.1.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.1.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.1.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:793)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.1.0)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:208)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.1.0)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.1.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    Kind Regards,
    Kay

  • Value based Hierarchies

    Hello,
    Has anyone created a parent-child hierarchy using Oracle Warehouse Builder or Analytic Workspace Manager. I am using Oracle 10g Rel2 (and AWM) and OWB 10g Rel2.
    The values in the dimension table defines the hierarchy.
    I don't see an option of creating a value-based hierarchy in OWB though it is mentioned that it supports this particular hierarchy.
    In AWM, I am able to create the hierarchy but when I try to view the data in the dimension it gives an error BIB-9531 Invalid hierarchy specified.
    Can you please let me know if I am missing something.
    Thanks a lot in advance!
    Regards,
    Maruthi

    To create a value based hierarchy:
    define the storage as MOLAP, as a minimum create 2 attributes one for the dimension member (define as business in Identifier column), one for the parent member referenece (define as parent in Identifier column), the hierarchy will have no levels. If you add this dimension into a map, you should have a mapping port for both the dimension member and the parent reference. The dimension will use 'Use natural keys from data source'.
    There is an expert for simplifying some of this, not sure on when it will be made available on OTN, it drives the creation of the dimensional objects from tables/views etc..

  • TransformServlet in cmsxdb compiles but fails deployment

    Can someone help me with cmsxdb? The transformservlet fails to deploy with the following errors:
    Invoking loadjava on connection 'CmsDB' with arguments:
    -resolve -force -grant public -thin -verbose
    creating : source oracle/otnsamples/cmsxdb/dbmanager/TransformServlet
    loading : source oracle/otnsamples/cmsxdb/dbmanager/TransformServlet
    granting : execute on source oracle/otnsamples/cmsxdb/dbmanager/TransformServlet to public
    granting : execute on class oracle/otnsamples/cmsxdb/dbmanager/TransformServlet to public
    resolving: source oracle/otnsamples/cmsxdb/dbmanager/TransformServlet
    errors : source oracle/otnsamples/cmsxdb/dbmanager/TransformServlet
    symbol : class Logger
    location: class oracle.otnsamples.cmsxdb.dbmanager.TransformServlet
    private Logger fopLog = null;
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:283: cannot resolve symbol
    symbol : class Driver
    location: class oracle.otnsamples.cmsxdb.dbmanager.TransformServlet
    fopDriver = new Driver( );
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:287: cannot resolve symbol
    symbol : class Hierarchy
    location: class oracle.otnsamples.cmsxdb.dbmanager.TransformServlet
    Hierarchy hierarchy = Hierarchy.getDefaultHierarchy();
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:287: cannot resolve symbol
    symbol : variable Hierarchy
    location: class oracle.otnsamples.cmsxdb.dbmanager.TransformServlet
    Hierarchy hierarchy = Hierarchy.getDefaultHierarchy();
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:289: cannot resolve symbol
    symbol : variable Priority
    location: class oracle.otnsamples.cmsxdb.dbmanager.TransformServlet
    fopLog.setPriority(Priority.WARN);
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:330: cannot resolve symbol
    symbol : variable Driver
    location: class oracle.otnsamples.cmsxdb.dbmanager.TransformServlet
    int renderer = Driver.RENDER_PDF;
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:333: cannot resolve symbol
    symbol : variable Driver
    location: class oracle.otnsamples.cmsxdb.dbmanager.TransformServlet
    renderer = Driver.RENDER_PDF;
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:335: cannot resolve symbol
    symbol : variable Driver
    location: class oracle.otnsamples.cmsxdb.dbmanager.TransformServlet
    renderer = Driver.RENDER_XML;
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:337: cannot resolve symbol
    symbol : variable Driver
    location: class oracle.otnsamples.cmsxdb.dbmanager.TransformServlet
    renderer = Driver.RENDER_TXT;
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:339: cannot resolve symbol
    symbol : variable Driver
    location: class oracle.otnsamples.cmsxdb.dbmanager.TransformServlet
    renderer = Driver.RENDER_PS;
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:341: cannot resolve symbol
    symbol : variable Driver
    location: class oracle.otnsamples.cmsxdb.dbmanager.TransformServlet
    renderer = Driver.RENDER_SVG;
    ^
    16 errors
    ORA-29535: source requires recompilation
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:35: cannot resolve symbol
    symbol : class Driver
    location: package apps
    import org.apache.fop.apps.Driver;
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:37: cannot resolve symbol
    symbol : class Priority
    location: package log
    import org.apache.log.Priority;
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:38: cannot resolve symbol
    symbol : class Hierarchy
    location: package log
    import org.apache.log.Hierarchy;
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:39: cannot resolve symbol
    symbol : class Logger
    location: package log
    import org.apache.log.Logger;
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:52: cannot resolve symbol
    symbol : class Driver
    location: class oracle.otnsamples.cmsxdb.dbmanager.TransformServlet
    private Driver fopDriver = null;
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:55: cannot resolve symbol
    The following operations failed
    source oracle/otnsamples/cmsxdb/dbmanager/TransformServlet: resolution
    oracle.aurora.server.tools.loadjava.ToolsException: Failures occurred during processing
         at oracle.aurora.server.tools.loadjava.LoadJava.process(LoadJava.java:863)
         at oracle.jdeveloper.deploy.tools.OracleLoadjava.deploy(OracleLoadjava.java:117)
         at oracle.jdeveloper.deploy.tools.OracleLoadjava.deploy(OracleLoadjava.java:47)
         at oracle.jdevimpl.deploy.OracleDeployer.deploy(OracleDeployer.java:97)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:447)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:334)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeployToMostRecent(StoredProcHandler.java:248)
         at oracle.jdevimpl.deploy.StoredProcProfileDt$1.run(StoredProcProfileDt.java:196)
    #### Deployment incomplete. #### Oct 2, 2006 10:22:02 AM

    Can someone help me with cmsxdb? The transformservlet fails to deploy with the following errors:
    Invoking loadjava on connection 'CmsDB' with arguments:
    -resolve -force -grant public -thin -verbose
    creating : source oracle/otnsamples/cmsxdb/dbmanager/TransformServlet
    loading : source oracle/otnsamples/cmsxdb/dbmanager/TransformServlet
    granting : execute on source oracle/otnsamples/cmsxdb/dbmanager/TransformServlet to public
    granting : execute on class oracle/otnsamples/cmsxdb/dbmanager/TransformServlet to public
    resolving: source oracle/otnsamples/cmsxdb/dbmanager/TransformServlet
    errors : source oracle/otnsamples/cmsxdb/dbmanager/TransformServlet
    symbol : class Logger
    location: class oracle.otnsamples.cmsxdb.dbmanager.TransformServlet
    private Logger fopLog = null;
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:283: cannot resolve symbol
    symbol : class Driver
    location: class oracle.otnsamples.cmsxdb.dbmanager.TransformServlet
    fopDriver = new Driver( );
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:287: cannot resolve symbol
    symbol : class Hierarchy
    location: class oracle.otnsamples.cmsxdb.dbmanager.TransformServlet
    Hierarchy hierarchy = Hierarchy.getDefaultHierarchy();
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:287: cannot resolve symbol
    symbol : variable Hierarchy
    location: class oracle.otnsamples.cmsxdb.dbmanager.TransformServlet
    Hierarchy hierarchy = Hierarchy.getDefaultHierarchy();
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:289: cannot resolve symbol
    symbol : variable Priority
    location: class oracle.otnsamples.cmsxdb.dbmanager.TransformServlet
    fopLog.setPriority(Priority.WARN);
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:330: cannot resolve symbol
    symbol : variable Driver
    location: class oracle.otnsamples.cmsxdb.dbmanager.TransformServlet
    int renderer = Driver.RENDER_PDF;
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:333: cannot resolve symbol
    symbol : variable Driver
    location: class oracle.otnsamples.cmsxdb.dbmanager.TransformServlet
    renderer = Driver.RENDER_PDF;
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:335: cannot resolve symbol
    symbol : variable Driver
    location: class oracle.otnsamples.cmsxdb.dbmanager.TransformServlet
    renderer = Driver.RENDER_XML;
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:337: cannot resolve symbol
    symbol : variable Driver
    location: class oracle.otnsamples.cmsxdb.dbmanager.TransformServlet
    renderer = Driver.RENDER_TXT;
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:339: cannot resolve symbol
    symbol : variable Driver
    location: class oracle.otnsamples.cmsxdb.dbmanager.TransformServlet
    renderer = Driver.RENDER_PS;
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:341: cannot resolve symbol
    symbol : variable Driver
    location: class oracle.otnsamples.cmsxdb.dbmanager.TransformServlet
    renderer = Driver.RENDER_SVG;
    ^
    16 errors
    ORA-29535: source requires recompilation
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:35: cannot resolve symbol
    symbol : class Driver
    location: package apps
    import org.apache.fop.apps.Driver;
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:37: cannot resolve symbol
    symbol : class Priority
    location: package log
    import org.apache.log.Priority;
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:38: cannot resolve symbol
    symbol : class Hierarchy
    location: package log
    import org.apache.log.Hierarchy;
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:39: cannot resolve symbol
    symbol : class Logger
    location: package log
    import org.apache.log.Logger;
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:52: cannot resolve symbol
    symbol : class Driver
    location: class oracle.otnsamples.cmsxdb.dbmanager.TransformServlet
    private Driver fopDriver = null;
    ^
    oracle/otnsamples/cmsxdb/dbmanager/TransformServlet:55: cannot resolve symbol
    The following operations failed
    source oracle/otnsamples/cmsxdb/dbmanager/TransformServlet: resolution
    oracle.aurora.server.tools.loadjava.ToolsException: Failures occurred during processing
         at oracle.aurora.server.tools.loadjava.LoadJava.process(LoadJava.java:863)
         at oracle.jdeveloper.deploy.tools.OracleLoadjava.deploy(OracleLoadjava.java:117)
         at oracle.jdeveloper.deploy.tools.OracleLoadjava.deploy(OracleLoadjava.java:47)
         at oracle.jdevimpl.deploy.OracleDeployer.deploy(OracleDeployer.java:97)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:447)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:334)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeployToMostRecent(StoredProcHandler.java:248)
         at oracle.jdevimpl.deploy.StoredProcProfileDt$1.run(StoredProcProfileDt.java:196)
    #### Deployment incomplete. #### Oct 2, 2006 10:22:02 AM

  • Account-Tree-CSE

    Hello
    I tried out the Account-Tree-CSE from the following link
    http://www.oracle.com/technetwork/indexes/samplecode/crmod-sample-522104.html
    Hopefully it will show us the Account Hierarchy in Oracle CRM On Demand.
    Did anyone knows the +"Relative URL of the CSE"+ which should be insert in the step
    7. Replace %%%PATH_CSE%%% with the ...
    as described in the file +"web applet code for accountTree1.txt";+?
    Kind regards,
    Luis

    Headers always come with amounts=0.
    Details come with different amounts. If the amounts don't meet a selected criteria, then details get suppressed. Headers come before the details, they don't know whether or not details meet the criteria.

  • Creating an Analytic Workspace

    Hi,
    i want to create an analytic Workspace without the AWM, but I want to see the Dimensions Cubes, etc what I create in the AWM. I Work with the AWM 10.2.0.3.0. What packages must I use for it? Someone say I must use the cwm2 and the dbms package an otherone say that I must use the AW/XML package.
    Give it a Example for Creating an AWM??
    Thanks

    If you want to create the AW without manually sitting in front of the AWM, Oracle prefers you to use the AWXML and AWAction packages in Java. If you have the AWM installed on your machine, you have the jar files you need in the AWM install directory. Download JDEV and try to load and compile this example program as a way to start learning the library.
    package oracle.olapi.examples;
    import oracle.AWAction.BuildDatabase;
    import oracle.AWAction.Interaction;
    import oracle.AWXML.AggregationDefinition;
    import oracle.AWXML.AggregationHierarchySpecification;
    import oracle.AWXML.Attribute;
    import oracle.AWXML.AttributeProjection;
    import oracle.AWXML.AttributeSourceExpression;
    import oracle.AWXML.AW;
    import oracle.AWXML.AWConnection;
    import oracle.AWXML.Cube;
    import oracle.AWXML.CubeDimensionSourceExpression;
    import oracle.AWXML.CubeDimRef;
    import oracle.AWXML.CubeMapGroup;
    import oracle.AWXML.Dimension;
    import oracle.AWXML.DimensionKeySourceExpression;
    import oracle.AWXML.DimensionMapGroup;
    import oracle.AWXML.DimensionMemberExpression;
    import oracle.AWXML.HierarchicalParentSourceExpression;
    import oracle.AWXML.Hierarchy;
    import oracle.AWXML.HierarchyLevelAssociation;
    import oracle.AWXML.Level;
    import oracle.AWXML.Measure;
    import oracle.AWXML.MeasureFolder;
    import oracle.AWXML.MeasureSourceExpression;
    import oracle.AWXML.PreComputeClause;
    import oracle.AWXML.SourceColumn;
    import oracle.express.spl.SPLExecutor;
    import oracle.jdbc.OracleConnection;
    import java.io.File;
    import java.io.FileWriter;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.Iterator;
    import java.util.Properties;
    import java.util.StringTokenizer;
    import java.util.Vector;
    * Creates an analytic workspace based on the Global schema and populates
    * the analytic workspace with data from the tables of that relational schema.
    * Before creating the analytic workspace, the program deletes an analytic
    * workspace of the same name if it already exists.
    * The program generates a log file and it creates a file that records the
    * creation of the Oracle OLAP Analytic Workspace Java API objects as an XML string.
    * This program requires the Global schema, which is available on the Oracle
    * Technology Network at
    * http://www.oracle.com/technology/products/bi/olap/olap.html
    * To download the sample schema, in the Documentation section see Sample
    * Schemas for Documentation.
    * To run this program, use the following command-line arguments, where
    * server_name is the server on which the Oracle Database is running,
    * port is the number of the port on which Oracle OLAP is listening,
    * and sid is the system identifier (SID) of the database instance:
    * -conn server_name:port:sid -user global_aw -password global_aw
    * Instead of the -conn argument, you could substitute a -url argument
    * of the following form:
    * -url jdbc:oracle:thin:@server_name:port:sid
    * An example of the command-line arguments is the following:
    * -conn myOracleServer:1521:orcl -user global_aw -password global_aw
    public class BuildAWExample extends BaseExample
    public static AWConnection awConnection;
    private Interaction curInteraction;
    // The elements in the _keys Vector are the relational key columns to which
    // a Level is mapped.
    Vector _keys = new Vector(0);
    // The elements in the _cols Vector are the relational columns to which
    // the attributes for a Level are mapped.
    Vector _cols = new Vector(0);
    // The elements in the _levels Vector are the Level objects for specifying
    // the levels of a hierarchy.
    Vector _levels = new Vector(0);
    // The elements in the _levColumns Vector are the relation columns to which
    // the levels of the hierarchy are mapped.
    Vector _levColumns = new Vector(0);
    Vector _dimList = new Vector(0);
    Vector _measures = new Vector(0);
    Vector _measCols = new Vector(0);
    // File name for writing the XML string.
    String xmlStr = "buildAWEx.xml";
    // File for AW build log.
    String xmlBldStr = "buildAWEx.log";
    * Constructor.
    public void BuildAWExample()
    * Creates the top-level objects for the analytic workspace and calls methods
    * that create the lower-level objects.
    * Writes the analytic workspace objects to an XML string.
    * Builds the analytic workspace framework and populates the analytic
    * workspace with data.
    * Connects to the Oracle Database instance, retrieves information
    * about the construction of the analytic workspace, and writes the
    * information to a log file.
    * Finally, closes the connection to the database.
    public void run() throws Exception
    // Get the command line arguments that are stored in the Properties object.
    String connection = getConnectionProperty(props);
    String user = props.getProperty("user");
    String password = props.getProperty("password");
    // Create the AWConnection.
    try
    System.out.println("Connecting to " + connection + ".");
    awConnection = new AWConnection(user, password, connection);
    catch(Exception e)
    System.out.println("Error connecting to " + connection + ".\n" + e);
    // Specify a name for the analytic workspace.
    String awName = "GLOBALAW";
    // Delete the analytic workspace if it already exists.
    deleteExistingAW(awConnection, user, awName);
    // Create an AW object and give it a name.
    AW globalAW = new AW();
    globalAW.setName(awName);
    // Create Dimension objects, and pass each Dimension to a method that
    // creates Attribute, Hierarchy, and Level objects for it.
    // Create the TIME_AW Dimension and set names for the object.
    Dimension timeDim = globalAW.createDimension();
    timeDim.setName("TIME_AW");
    timeDim.setShortName("TIME_AW");
    timeDim.setLongName("TIME_AW dimension");
    timeDim.setIsTime(true);
    // Create the Attribute, Level, and Hierarchy objects for the Dimension.
    this.createTimeDim(timeDim);
    // Get the detail level to use when creating a Cube.
    Vector timelevels = timeDim.getLevels();
    Level monthLevel = (Level)_time_levels.elementAt(0);
    // Create the CUSTOMER_AW Dimension and set names for the object.
    Dimension customerDim = globalAW.createDimension();
    customerDim.setName("CUSTOMER_AW");
    customerDim.setShortName("CUSTOMER_AW");
    customerDim.setLongName("CUSTOMER_AW dimension");
    // Create the Attribute, Level, and Hierarchy objects for the Dimension.
    this.createCustomerDim(customerDim);
    // Get the detail level to use when creating a Cube.
    Vector customerDim_levels = customerDim.getLevels();
    Level shipToLevel = (Level)customerDim_levels.elementAt(0);
    // Create the PRODUCT_AW Dimension and set names for the object.
    Dimension productDim = globalAW.createDimension();
    productDim.setName("PRODUCT_AW");
    productDim.setShortName("PRODUCT_AW");
    productDim.setLongName("PRODUCT_AW Dimension");
    // Create the Attribute, Level, and Hierarchy objects for the Dimension.
    this.createProductDim(productDim);
    // Get the detail level to use when creating a Cube.
    Vector productDim_levels = productDim.getLevels();
    Level itemLevel = (Level)productDim_levels.elementAt(0);
    // Create the CHANNEL_AW Dimension and set names for the object.
    Dimension channelDim = globalAW.createDimension();
    channelDim.setName("CHANNEL_AW");
    channelDim.setShortName("CHANNEL_AW");
    channelDim.setLongName("CHANNEL_AW dimension");
    // Create the Attribute, Level, and Hierarchy objects for the Dimension.
    this.createChannelDimension(channelDim);
    // Get the detail level, which is shared by all dimension hierarchies,
    // to use when creating a Cube.
    Vector channellevels = channelDim.getLevels();
    Level channelLevel = (Level)_channel_levels.elementAt(0);
    // Create the UNITS_CUBE_AW Cube and the measures to associate with it.
    this.clearCubeMapVectors();
    Cube unitsCube = globalAW.createCube();
    unitsCube.setName("UNITS_CUBE_AW");
    // Add the dimensions to the _dimList Vector.
    _dimList.add(timeDim);
    _dimList.add(customerDim);
    _dimList.add(productDim);
    _dimList.add(channelDim);
    // Specify the dimensions for the Cube.
    this.associateCubeDimensions(unitsCube, _dimList);
    // Create an aggregation map for the Cube.
    this.precomputeNA(unitsCube, "AGGMAP_UC");
    // Create a Measure for the quantities of units sold.
    Measure units = unitsCube.createMeasure();
    units.setName("UNITS_AW");
    units.setShortName("UNITS_AW");
    units.setLongName("UNITS_AW measure");
    units.setDataType("NUMBER");
    // Add the Measure to the _measures Vector.
    _measures.add(units);
    // Add the column of the Global schema relational table to the
    // _measCols Vector.
    measCols.add("GLOBAL.UNITSHISTORY_FACT.UNITS");
    // Create a Measure for the monetary amount of units sold.
    Measure sales = unitsCube.createMeasure();
    sales.setName("SALES_AW");
    sales.setShortName("SALES_AW");
    sales.setLongName("SALES_AW measure");
    sales.setDataType("NUMBER");
    _measures.add(sales);
    _measCols.add("GLOBAL.UNITS_HISTORY_FACT.SALES");
    // Add the detail levels for the dimensions to the _levels Vector and
    // the relational columns for the levels to the _cols Vector.
    _levels.add(monthLevel);
    _cols.add("GLOBAL.UNITS_HISTORY_FACT.MONTH_ID");
    _levels.add(shipToLevel);
    _cols.add("GLOBAL.UNITS_HISTORY_FACT.SHIP_TO_ID");
    _levels.add(itemLevel);
    _cols.add("GLOBAL.UNITS_HISTORY_FACT.ITEM_ID");
    _levels.add(channelLevel);
    _cols.add("GLOBAL.UNITS_HISTORY_FACT.CHANNEL_ID");
    // Map the columns of the relational tables to the dimensions and measures
    // of the analytic workspace Cube.
    this.createCubeMap(unitsCube, _levels, _cols, _measures, _measCols);
    // Create the PRICE_COST_CUBE_AW Cube and the measures to associate with it.
    this.clearCubeMapVectors();
    Cube priceCostCube = globalAW.createCube();
    priceCostCube.setName("PRICE_COST_CUBE_AW");
    _dimList.add(productDim);
    _dimList.add(timeDim);
    this.associateCubeDimensions(priceCostCube, _dimList);
    this.precomputeNA(priceCostCube, "AGGMAP_PCC");
    // Create a Measure for unit prices.
    Measure price = priceCostCube.createMeasure();
    price.setName("UNIT_PRICE_AW");
    price.setShortName("UNIT_PRICE_AW");
    price.setLongName("UNIT_PRICE_AW measure");
    price.setDataType("NUMBER");
    _measures.add(price);
    _measCols.add("GLOBAL.PRICE_AND_COST_HIST_FACT.UNIT_PRICE");
    // Create a Measure for unit costs.
    Measure cost = priceCostCube.createMeasure();
    cost.setName("UNIT_COST_AW");
    price.setShortName("UNIT_COST_AW");
    cost.setLongName("UNIT_COST_AW measure");
    cost.setDataType("NUMBER");
    _measures.add(cost);
    _measCols.add("GLOBAL.PRICE_AND_COST_HIST_FACT.UNIT_COST");
    _levels.add(itemLevel);
    _cols.add("GLOBAL.PRICE_AND_COST_HIST_FACT.ITEM_ID");
    _levels.add(monthLevel);
    _cols.add("GLOBAL.PRICE_AND_COST_HIST_FACT.MONTH_ID");
    this.createCubeMap(priceCostCube, _levels, _cols, _measures, _measCols);
    // Create a MeasureFolder and add the measures to it.
    // A MeasureFolder appears as an MdmSchema object to an
    // Oracle OLAP Java API application.
    MeasureFolder measureFolder = globalAW.createMeasureFolder();
    measureFolder.setName("GLOBALAW_SCHEMA");
    measureFolder.setShortName("GLOBALAW_SCHEMA");
    measureFolder.setLongName("GLOBALAW_SCHEMA schema");
    measureFolder.addMeasure(units);
    measureFolder.addMeasure(sales);
    measureFolder.addMeasure(cost);
    measureFolder.addMeasure(price);
    // Write the XML string for the analytic workspace.
    String XML = globalAW.WriteToXML();
    try
    File xmlFile = new File(xmlStr);
    FileWriter xmlout = new FileWriter(xmlFile);
    xmlout.write(XML);
    xmlout.write("\n");
    xmlout.close();
    catch (Exception e)
    System.out.println("Failure to write XML string to file: " +
    e.toString());
    // Build the analytic workspace framework.
    System.out.println("Building the " + awName + " framework.");
    globalAW.Create(awConnection);
    globalAW.Commit(awConnection);
    System.out.println(awName + " framework built!");
    // Populate the analytic workspace with the metadata objects and
    // the data from the relational schema.
    System.out.println("Populating " + awName + "." );
    try
    xml_build_global_aw(awName);
    catch(Exception e)
    System.out.println("The following error occurred while building "
    + awName + ":\n\t" + e.toString());
    // Connect to the Oracle Database instance and retrieve information
    // about building the analytic workspace.
    try
    // Create a DriverManager.
    DriverManager.registerDriver (new oracle.jdbc.OracleDriver());
    // Create a connection to the Oracle Database instance.
    OracleConnection o_connection =
    (OracleConnection)DriverManager.getConnection("jdbc:oracle:thin:@" +
    connection, user, password);
    // Get information from the olapsys.xml_load_log table.
    String result = null;
    String sqlText = "select distinct xml_loadid " +
    "from olapsys.xml_load_log " +
    "order by xml_loadid desc";
    Statement sqlStmt = o_connection.createStatement();
    ResultSet rs = sqlStmt.executeQuery(sqlText);
    if(rs.next())
    // Get the first value.
    int loadid = rs.getInt(1);
    rs.close();
    // Now get the rest of the log without the timestamp for easy diffing.
    sqlText = "select SUBSTR(xml_message, 9) xml_message " +
    "from olapsys.xml_load_log " +
    "where xml_loadid = " + loadid + " " +
    "order by xml_loadid, xml_recordid";
    rs = sqlStmt.executeQuery(sqlText);
    String tempResult;
    while(rs.next())
    tempResult = rs.getString(1);
    if(result == null)
    result = tempResult.trim();
    else
    result = result + "\n" + tempResult.trim();
    // Write the information to a file.
    try
    File xmlBuildLog = new File(xmlBldStr);
    FileWriter xmlBldout = new FileWriter(xmlBuildLog);
    xmlBldout.write(result);
    xmlBldout.write("\n");
    xmlBldout.close();
    catch (Exception e)
    System.out.println("Failure to write XML build log: " + e.toString());
    catch(Exception e)
    System.out.println("Verifier failure with " + e.toString());
    // Close the connection to the database.
    awConnection.close();
    * Builds the analytic workspace.
    public void xml_build_global_aw(String awName)
    // Create an Interaction object for building the analytic workspace.
    curInteraction = new Interaction();
    // Set the AWConnection to use when building the analytic workspace.
    curInteraction.setConnection(awConnection);
    // Create an BuildDatabase object.
    BuildDatabase myBuild =
    (BuildDatabase)curInteraction.createAction("BUILDDATABASE");
    // Set the name of the analytic workspace.
    myBuild.setAWName(awName);
    // Specify not running solves when building the database.
    myBuild.setRunSolve(false);
    // Build the analytic workspace.
    myBuild.Execute();
    * Creates Attribute, Level, and Hierarchy objects for the Time Dimension.
    public void createTimeDim(Dimension timeDim)
    // Indicate that the primary key of the dimension table contains the
    // lowest-level dimension members.
    timeDim.setUseNativeKey(true);
    // Create the Long and Short Description Attribute objects for the Dimension.
    Attribute timeLDAttr = createLongDescAttr(timeDim);
    Attribute timeSDAttr = createShortDescAttr(timeDim);
    // Create the End_Date and Time_Span Attribute objects.
    Attribute timeEndDateAttr = timeDim.createAttribute();
    timeEndDateAttr.setName("End_Date");
    timeEndDateAttr.setClassification("END_DATE");
    Attribute timeTimeSpanAttr = timeDim.createAttribute();
    timeTimeSpanAttr.setName("Time_Span");
    timeTimeSpanAttr.setClassification("TIME_SPAN");
    // Create the Level objects for the Dimension.
    // Create the detail level, MONTH_AW.
    Level monthLevel = timeDim.createLevel();
    monthLevel.setName("MONTH_AW");
    monthLevel.setShortName("MONTH_AW");
    monthLevel.setLongName("MONTH_AW level");
    // Create AttributeProjection objects for the attributes for the
    // MONTH_AW Level.
    this.setupAttributeProjection(monthLevel, "Long Description", timeLDAttr);
    this.setupAttributeProjection(monthLevel, "Short Description", timeSDAttr);
    this.setupAttributeProjection(monthLevel, "End Date", timeEndDateAttr);
    this.setupAttributeProjection(monthLevel, "Time Span", timeTimeSpanAttr);
    this.clearLevelMapVectors();
    _keys.add("GLOBAL.TIME_DIM.MONTH_ID");
    _cols.add("GLOBAL.TIME_DIM.MONTH_DSC"); // Long description
    _cols.add("GLOBAL.TIME_DIM.MONTH_DSC"); // Short description
    _cols.add("GLOBAL.TIME_DIM.MONTH_END_DATE");
    _cols.add("GLOBAL.TIME_DIM.MONTH_TIMESPAN");
    this.createLevelMap(monthLevel, _keys,_cols);
    // Create the QUARTER_AW Level.
    Level quarterLevel = timeDim.createLevel();
    quarterLevel.setName("QUARTER_AW");
    quarterLevel.setShortName("QUARTER_AW");
    quarterLevel.setLongName("QUARTER_AW level");
    // Create AttributeProjection objects for the attributes for the
    // QUARTER_AW Level.
    this.setupAttributeProjection(quarterLevel, "Long Description",
    timeLDAttr);
    this.setupAttributeProjection(quarterLevel, "Short Description",
    timeSDAttr);
    this.setupAttributeProjection(quarterLevel, "End Date", timeEndDateAttr);
    this.setupAttributeProjection(quarterLevel, "Time Span", timeTimeSpanAttr);
    this.clearLevelMapVectors();
    _keys.add("GLOBAL.TIME_DIM.QUARTER_ID");
    _cols.add("GLOBAL.TIME_DIM.QUARTER_DSC"); // Long description
    _cols.add("GLOBAL.TIME_DIM.QUARTER_DSC"); // Short description
    _cols.add("GLOBAL.TIME_DIM.QUARTER_END_DATE");
    _cols.add("GLOBAL.TIME_DIM.QUARTER_TIMESPAN");
    this.createLevelMap(quarterLevel, _keys, _cols);
    // Create the top level, YEAR_AW.
    Level yearLevel = timeDim.createLevel();
    yearLevel.setName("YEAR_AW");
    yearLevel.setShortName("YEAR_AW");
    yearLevel.setLongName("YEAR_AW level");
    // Create AttributeProjection objects for the attributes for the
    // YEAR_AW Level.
    this.setupAttributeProjection(yearLevel, "Long Description", timeLDAttr);
    this.setupAttributeProjection(yearLevel, "Short Description", timeSDAttr);
    this.setupAttributeProjection(yearLevel, "End Date", timeEndDateAttr);
    this.setupAttributeProjection(yearLevel, "Time Span", timeTimeSpanAttr);
    this.clearLevelMapVectors();
    _keys.add("GLOBAL.TIME_DIM.YEAR_ID");
    _cols.add("GLOBAL.TIME_DIM.YEAR_DSC"); // Long description
    _cols.add("GLOBAL.TIME_DIM.YEAR_DSC"); // Short description
    _cols.add("GLOBAL.TIME_DIM.YEAR_END_DATE");
    _cols.add("GLOBAL.TIME_DIM.YEAR_TIMESPAN");
    this.createLevelMap(yearLevel, _keys, _cols);
    // Create the CALENDAR_YEAR_AW Hierarchy.
    Hierarchy calendarYearHier = timeDim.createHierarchy();
    calendarYearHier.setName("CALENDAR_YEAR_AW");
    calendarYearHier.setShortName("CALENDAR_YEAR_AW");
    calendarYearHier.setLongName("CALENDAR_YEAR_AW hierarchy");
    // Add the Level objects for the Hierarchy, and the columns for them,
    // to Vector objects in the hierarcharchical order of the levels,
    // with the top level first.
    this.clearHierarchyMapVectors();
    _levels.add(yearLevel);
    _levColumns.add("GLOBAL.TIME_DIM.YEAR_ID");
    _levels.add(quarterLevel);
    _levColumns.add("GLOBAL.TIME_DIM.QUARTER_ID");
    _levels.add(monthLevel);
    _levColumns.add("GLOBAL.TIME_DIM.MONTH_ID");
    // Specify the levels for the hierarchy and map them to relational columns.
    this.createHierarchyMap(calendarYearHier, _levels, _levColumns);
    * Create the Long_Description Attribute for a Dimension.
    public Attribute createLongDescAttr(Dimension dim)
    Attribute ldAttr = dim.createAttribute();
    ldAttr.setName("Long_Description");
    ldAttr.setClassification("MEMBER_LONG_DESCRIPTION");
    return ldAttr;
    * Creates Attribute, Hierarchy, and Level objects for the Customer Dimension.
    public void createCustomerDim(Dimension customerDim)
    // Indicate that the primary key of the dimension table contains the
    // lowest-level dimension members.
    customerDim.setUseNativeKey(true);
    // Create the Long and Short Description Attribute objects for the Dimension.
    Attribute customerLDAttr = createLongDescAttr(customerDim);
    Attribute customerSDAttr = createShortDescAttr(customerDim);
    // Create Level objects for the SHIPMENTS_AW Hierarchy.
    // Create the detail level, SHIP_TO_AW.
    // This level is in both of the hierarchies of the Customer Dimension.
    Level customerShip_ToLevel = customerDim.createLevel();
    customerShip_ToLevel.setName("SHIP_TO_AW");
    customerShip_ToLevel.setShortName("SHIP_TO_AW");
    customerShip_ToLevel.setLongName("SHIP_TO_AW level");
    // Create the Long and Short Description AttributeProjection objects for
    // SHIP_TO_AW Level.
    this.setupAttributeProjection(customerShip_ToLevel, "Long Description",
    customerLDAttr);
    this.setupAttributeProjection(customerShip_ToLevel, "Short Description",
    customerSDAttr);
    this.clearLevelMapVectors();
    _keys.add("GLOBAL.CUSTOMER_DIM.SHIP_TO_ID");
    _cols.add("GLOBAL.CUSTOMER_DIM.SHIP_TO_DSC"); // Long description
    _cols.add("GLOBAL.CUSTOMER_DIM.SHIP_TO_DSC"); // Short description
    this.createLevelMap(customerShip_ToLevel, _keys, _cols);
    // Create the WAREHOUSE_AW level.
    Level customerWarehouseLevel = customerDim.createLevel();
    customerWarehouseLevel.setName("WAREHOUSE_AW");
    customerWarehouseLevel.setShortName("WAREHOUSE_AW");
    customerWarehouseLevel.setLongName("WAREHOUSE_AW level");
    // Create the Long and Short Description AttributeProjection objects for
    // WAREHOUSE_AW Level.
    this.setupAttributeProjection(customerWarehouseLevel, "Long Description",
    customerLDAttr);
    this.setupAttributeProjection(customerWarehouseLevel, "Short Description",
    customerSDAttr);
    this.clearLevelMapVectors();
    _keys.add("GLOBAL.CUSTOMER_DIM.WAREHOUSE_ID");
    _cols.add("GLOBAL.CUSTOMER_DIM.WAREHOUSE_DSC"); // Long description
    _cols.add("GLOBAL.CUSTOMER_DIM.WAREHOUSE_DSC"); // Short description
    this.createLevelMap(customerWarehouseLevel, _keys, _cols);
    // Create the REGION_AW Level.
    Level custRegionLevel = customerDim.createLevel();
    custRegionLevel.setName("REGION_AW");
    custRegionLevel.setShortName("REGION_AW");
    custRegionLevel.setLongName("REGION_AW level");
    // Create the Long and Short Description AttributeProjection objects for
    // the REGION_AW Level.
    this.setupAttributeProjection(custRegionLevel, "Long Description",
    customerLDAttr);
    this.setupAttributeProjection(custRegionLevel, "Short Description",
    customerSDAttr);
    this.clearLevelMapVectors();
    _keys.add("GLOBAL.CUSTOMER_DIM.REGION_ID");
    _cols.add("GLOBAL.CUSTOMER_DIM.REGION_DSC"); // Long description
    _cols.add("GLOBAL.CUSTOMER_DIM.REGION_DSC"); // Short description
    this.createLevelMap(custRegionLevel, _keys, _cols);
    // Create the top level, TOTAL_CUSTOMER_AW.
    Level allCustomersLevel = customerDim.createLevel();
    allCustomersLevel.setName("TOTAL_CUSTOMER_AW");
    allCustomersLevel.setShortName("TOTAL_CUSTOMER_AW");
    allCustomersLevel.setLongName("TOTAL_CUSTOMER_AW level");
    // Create the Long and Short Description AttributeProjection objects for
    // the ALL_CUSTOMERS_AW Level.
    this.setupAttributeProjection(allCustomersLevel, "Long Description",
    customerLDAttr);
    this.setupAttributeProjection(allCustomersLevel, "Short Description",
    customerSDAttr);
    this.clearLevelMapVectors();
    _keys.add("GLOBAL.CUSTOMER_DIM.TOTAL_CUSTOMER_ID");
    _cols.add("GLOBAL.CUSTOMER_DIM.TOTAL_CUSTOMER_DSC"); // Long description
    _cols.add("GLOBAL.CUSTOMER_DIM.TOTAL_CUSTOMER_DSC"); // Short description
    this.createLevelMap(allCustomersLevel, _keys, _cols);
    // Create the SHIPMENTS_AW Hierarchy.
    Hierarchy shipmentsHier = customerDim.createHierarchy();
    shipmentsHier.setName("SHIPMENTS_AW");
    shipmentsHier.setShortName("SHIPMENTS_AW");
    shipmentsHier.setLongName("SHIPMENTS_AW hierarchy");
    // Add the Level objects for the Hierarchy, and the columns for them,
    // to Vector objects in the hierarcharchical order of the levels,
    // with the top level first.
    this.clearHierarchyMapVectors();
    _levels.add(allCustomersLevel);
    _levColumns.add("GLOBAL.CUSTOMER_DIM.TOTAL_CUSTOMER_ID");
    _levels.add(custRegionLevel);
    _levColumns.add("GLOBAL.CUSTOMER_DIM.REGION_ID");
    _levels.add(customerWarehouseLevel);
    _levColumns.add("GLOBAL.CUSTOMER_DIM.WAREHOUSE_ID");
    _levels.add(customerShip_ToLevel);
    _levColumns.add("GLOBAL.CUSTOMER_DIM.SHIP_TO_ID");
    // Specify the levels for the hierarchy and map them to relational columns.
    this.createHierarchyMap(shipmentsHier, _levels, _levColumns);
    // Create Level objects for the MARKET_SEGMENT_AW Hierarchy.
    // Create the ACCOUNT_AW Level.
    Level customerAccountLevel = customerDim.createLevel();
    customerAccountLevel.setName("ACCOUNT_AW");
    customerAccountLevel.setShortName("ACCOUNT_AW");
    customerAccountLevel.setLongName("ACCOUNT_AW level");
    // Create the Long and Short Description AttributeProjection objects for
    // the ACCOUNT_AW Level.
    this.setupAttributeProjection(customerAccountLevel, "Long Description",
    customerLDAttr);
    this.setupAttributeProjection(customerAccountLevel, "Short Description",
    customerSDAttr);
    this.clearLevelMapVectors();
    _keys.add("GLOBAL.CUSTOMER_DIM.ACCOUNT_ID");
    _cols.add("GLOBAL.CUSTOMER_DIM.ACCOUNT_DSC"); // Long description
    _cols.add("GLOBAL.CUSTOMER_DIM.ACCOUNT_DSC"); // Short description
    this.createLevelMap(customerAccountLevel, _keys, _cols);
    // Create the MARKET_SEGMENT_AW Level.
    Level customerMktSegmentLevel = customerDim.createLevel();
    customerMktSegmentLevel.setName("MARKET_SEGMENT_AW");
    customerMktSegmentLevel.setShortName("MARKET_SEGMENT_AW");
    customerMktSegmentLevel.setLongName("MARKET_SEGMENT_AW level");
    // Create the Long and Short Description AttributeProjection objects for
    // the MARKET_SEGMENT_AW Level.
    this.setupAttributeProjection(customerMktSegmentLevel, "Long Description",
    customerLDAttr);
    this.setupAttributeProjection(customerMktSegmentLevel, "Short Description",
    customerSDAttr);
    this.clearLevelMapVectors();
    _keys.add("GLOBAL.CUSTOMER_DIM.MARKET_SEGMENT_ID");
    _cols.add("GLOBAL.CUSTOMER_DIM.MARKET_SEGMENT_DSC"); // Long description
    _cols.add("GLOBAL.CUSTOMER_DIM.MARKET_SEGMENT_DSC"); // Short description
    this.createLevelMap(customerMktSegmentLevel, _keys, _cols);
    // Create the top level, TOTAL_MARKET_AW.
    Level customerTotalMktLevel = customerDim.createLevel();
    customerTotalMktLevel.setName("TOTAL_MARKET_AW");
    customerTotalMktLevel.setShortName("TOTAL_MARKET_AW");
    customerTotalMktLevel.setLongName("TOTAL_MARKET_AW level");
    // Create AttributeProjection objects for the long and short description
    // attributes for the TOTAL_MARKET_AW Level.
    this.setupAttributeProjection(customerTotalMktLevel, "Long Description",
    customerLDAttr);
    this.setupAttributeProjection(customerTotalMktLevel, "Short Description",
    customerSDAttr);
    this.clearLevelMapVectors();
    _keys.add("GLOBAL.CUSTOMER_DIM.TOTAL_MARKET_ID");
    _cols.add("GLOBAL.CUSTOMER_DIM.TOTAL_MARKET_DSC"); // Long description
    _cols.add("GLOBAL.CUSTOMER_DIM.TOTAL_MARKET_DSC"); // Short description
    this.createLevelMap(customerTotalMktLevel, _keys, _cols);
    // Create the MARKET_SEGMENT_AW Hierarchy.
    Hierarchy marketSegmentHier = customerDim.createHierarchy();
    marketSegmentHier.setName("MARKET_SEGMENT_AW");
    marketSegmentHier.setShortName("MARKET_SEGMENT_AW");
    marketSegmentHier.setLongName("MARKET_SEGMENT_AW hierarchy");
    // Add the Level objects for the Hierarchy, and the columns for them,
    // to Vector objects in the hierarcharchical order of the levels,
    // with the top level first.
    this.clearHierarchyMapVectors();
    _levels.add(customerTotalMktLevel);
    _levColumns.add("GLOBAL.CUSTOMER_DIM.TOTAL_MARKET_ID");
    _levels.add(customerMktSegmentLevel);
    _levColumns.add("GLOBAL.CUSTOMER_DIM.MARKET_SEGMENT_ID");
    _levels.add(customerAccountLevel);
    _levColumns.add("GLOBAL.CUSTOMER_DIM.ACCOUNT_ID");
    _levels.add(customerShip_ToLevel);
    _levColumns.add("GLOBAL.CUSTOMER_DIM.SHIP_TO_ID");
    // Specify the levels for the hierarchy and map them to relational columns.
    this.createHierarchyMap(marketSegmentHier, _levels, _levColumns);
    * Creates Attribute, Level, and Hierarchy objects for the Product Dimension.
    public void createProductDim(Dimension productDim)
    // Indicate that the primary key of the dimension table contains the
    // lowest-level dimension members.
    productDim.setUseNativeKey(true);
    // Create the Attribute objects for the Dimension.
    Attribute packageAttr = productDim.createAttribute();
    packageAttr.setName("PACKAGE_AW");
    packageAttr.setClassification("USER");
    Attribute buyerAttr = productDim.createAttribute();
    buyerAttr.setName("BUYER_AW");
    buyerAttr.setClassification("USER");
    Attribute mktMngrAttr = productDim.createAttribute();
    mktMngrAttr.setName("MARKETING_MANAGER_AW");
    mktMngrAttr.setClassification("USER");
    Attribute productLDAttr = createLongDescAttr(productDim);
    Attribute productSDAttr = createShortDescAttr(productDim);
    // Create the detail level, ITEM_AW.
    Level itemLevel = productDim.createLevel();
    itemLevel.setName("ITEM_AW");
    itemLevel.setShortName("ITEM_AW");
    itemLevel.setLongName("ITEM_AW level");
    // Create AttributeProjection objects for the attributes for the
    // ITEM_AW Level.
    this.setupAttributeProjection(itemLevel, "PACKAGE_AW", packageAttr);
    this.setupAttributeProjection(itemLevel, "BUYER_AW", buyerAttr);
    this.setupAttributeProjection(itemLevel, "MARKETING_MANAGER_AW", mktMngrAttr);
    this.setupAttributeProjection(itemLevel, "Long Description", productLDAttr);
    this.setupAttributeProjection(itemLevel, "Short Description", productSDAttr);
    this.clearLevelMapVectors();
    _keys.add("GLOBAL.PRODUCT_DIM.ITEM_ID");
    _cols.add("GLOBAL.PRODUCT_DIM.ITEM_PACKAGE_ID");
    _cols.add("GLOBAL.PRODUCT_DIM.ITEM_BUYER");
    _cols.add("GLOBAL.PRODUCT_DIM.ITEM_MARKETING_MANAGER");
    _cols.add("GLOBAL.PRODUCT_DIM.ITEM_DSC"); // Long description
    _cols.add("GLOBAL.PRODUCT_DIM.ITEM_DSC"); // Short description
    this.createLevelMap(itemLevel, _keys,_cols);
    // Create the FAMILY_AW level.
    Level familyLevel = productDim.createLevel();
    familyLevel.setName("FAMILY_AW");
    familyLevel.setShortName("FAMILY_AW");
    familyLevel.setLongName("FAMILY_AW level");
    // Create AttributeProjection objects for the attributes for the
    // FAMILY_AW Level.
    this.setupAttributeProjection(familyLevel, "Long Description",
    productLDAttr);
    this.setupAttributeProjection(familyLevel, "Short Description",
    productSDAttr);
    this.clearLevelMapVectors();
    _keys.add("GLOBAL.PRODUCT_DIM.FAMILY_ID");
    _cols.add("GLOBAL.PRODUCT_DIM.FAMILY_DSC"); // Long description
    _cols.add("GLOBAL.PRODUCT_DIM.FAMILY_DSC"); // Short description
    this.createLevelMap(familyLevel, _keys,_cols);
    // Create the CLASS_AW level.
    Level classLevel = productDim.createLevel();
    classLevel.setName("CLASS_AW");
    classLevel.setShortName("CLASS_AW");
    classLevel.setLongName("CLASS_AW level");
    // Create AttributeProjection objects for the attributes for the
    // CLASS_AW Level.
    this.setupAttributeProjection(classLevel, "Long Description",
    productLDAttr);
    this.setupAttributeProjection(classLevel, "Short Description",
    productSDAttr);
    this.clearLevelMapVectors();
    _keys.add("GLOBAL.PRODUCT_DIM.CLASS_ID");
    _cols.add("GLOBAL.PRODUCT_DIM.CLASS_DSC"); // Long description
    _cols.add("GLOBAL.PRODUCT_DIM.CLASS_DSC"); // Short description
    this.createLevelMap(classLevel, _keys,_cols);
    // Create the top level, TOTAL_PRODUCT_AW.
    Level totalProductLevel = productDim.createLevel();
    totalProductLevel.setName("TOTAL_PRODUCT_AW");
    totalProductLevel.setShortName("TOTAL_PRODUCT_AW");
    totalProductLevel.setLongName("TOTAL_PRODUCT_AW level");
    // Create AttributeProjection objects for the attributes for the
    // TOTAL_PRODUCT_AW Level.
    this.setupAttributeProjection(totalProductLevel, "Long Description",
    productLDAttr);
    this.setupAttributeProjection(totalProductLevel, "Short Description",
    productSDAttr);
    this.clearLevelMapVectors();
    _keys.add("GLOBAL.PRODUCT_DIM.TOTAL_PRODUCT_ID");
    _cols.add("GLOBAL.PRODUCT_DIM.TOTAL_PRODUCT_DSC"); // Long description
    _cols.add("GLOBAL.PRODUCT_DIM.TOTAL_PRODUCT_DSC"); // Short description
    this.createLevelMap(totalProductLevel, _keys,_cols);
    // Create the PRODUCT_PRIMARY_AW Hierarchy.
    Hierarchy prodPrimaryHier = productDim.createHierarchy();
    prodPrimaryHier.setName("PRODUCT_PRIMARY_AW");
    prodPrimaryHier.setShortName("PRODUCT_PRIMARY_AW");
    prodPrimaryHier.setLongName("PRODUCT_PRIMARY_AW level");
    // Add the Level objects for the Hierarchy, and the columns for them,
    // to Vector objects in the hierarcharchical order of the levels,
    // with the top level first.
    this.clearHierarchyMapVectors();
    _levels.add(totalProductLevel);
    _levColumns.add("GLOBAL.PRODUCT_DIM.TOTAL_PRODUCT_ID");
    _levels.add(classLevel);
    _levColumns.add("GLOBAL.PRODUCT_DIM.CLASS_ID");
    _levels.add(familyLevel);
    _levColumns.add("GLOBAL.PRODUCT_DIM.FAMILY_ID");
    _levels.add(itemLevel);
    _levColumns.add("GLOBAL.PRODUCT_DIM.ITEM_ID");
    // Specify the levels for the hierarchy and map them to relational columns.
    this.createHierarchyMap(prodPrimaryHier, _levels, _levColumns);
    * Creates Attribute, Level, and Hierarchy objects for the Channel Dimension.
    public void createChannelDimension(Dimension channelDim)
    // Indicate that the primary key of the dimension table contains the
    // lowest-level dimension members.
    channelDim.setUseNativeKey(true);
    // Create the Long and Short Description Attribute objects for the Dimension.
    Attribute channelLDAttr = createLongDescAttr(channelDim);
    Attribute channelSDAttr = createShortDescAttr(channelDim);
    // Create the Level objects for the Dimension.
    // Create the detail level, CHANNEL_AW.
    Level channelLevel = channelDim.createLevel();
    channelLevel.setName("CHANNEL_AW");
    channelLevel.setShortName("CHANNEL_AW");
    channelLevel.setLongName("CHANNEL_AW level");
    // Create AttributeProjection objects for the long and short description
    // attributes for the CHANNEL_AW Level.
    this.setupAttributeProjection(channelLevel, "Long Description",
    channelLDAttr);
    this.setupAttributeProjection(channelLevel, "Short Description",
    channelSDAttr);
    this.clearLevelMapVectors();
    _keys.add("GLOBAL.CHANNEL_DIM.CHANNEL_ID");
    _cols.add("GLOBAL.CHANNEL_DIM.CHANNEL_DSC"); // Long description
    _cols.add("GLOBAL.CHANNEL_DIM.CHANNEL_DSC"); // Short description
    this.createLevelMap(channelLevel, _keys, _cols);
    // Create the top level, ALL_CHANNELS_AW.
    Level allChannelsLevel = channelDim.createLevel();
    allChannelsLevel.setName("TOTAL_CHANNEL_AW");
    allChannelsLevel.setShortName("TOTAL_CHANNEL_AW");
    allChannelsLevel.setLongName("TOTAL_CHANNEL_AW level");
    // Create the Long and Short Description AttributeProjection objects for
    // the TOTAL_CHANNEL_AW Level.
    this.setupAttributeProjection(allChannelsLevel, "Long Description",
    channelLDAttr);
    this.setupAttributeProjection(allChannelsLevel, "Short Description",
    channelSDAttr);
    this.clearLevelMapVectors();
    // The order of the elements in the _cols Vector depends on the order
    // in which the attributes are created.
    // Columns in the relational tables are specified in the form
    // user.tablename.column
    _keys.add("GLOBAL.CHANNEL_DIM.TOTAL_CHANNEL_ID");
    _cols.add("GLOBAL.CHANNEL_DIM.TOTAL_CHANNEL_DSC"); // Long description
    _cols.add("GLOBAL.CHANNEL_DIM.TOTAL_CHANNEL_DSC"); // Short description.
    this.createLevelMap(allChannelsLevel, _keys, _cols);
    // Create the CHANNEL_PRIMARY_AW Hierarchy.
    Hierarchy chanRollupHier = channelDim.createHierarchy();
    chanRollupHier.setName("CHANNEL_PRIMARY_AW");
    chanRollupHier.setShortName("CHANNEL_PRIMARY_AW");
    chanRollupHier.setLongName("CHANNEL_PRIMARY_AW hierarchy");
    // Add the Level objects for the Hierarchy, and the columns for them,
    // to Vector objects in the hierarcharchical order of the levels,
    // with the top level first.
    this.clearHierarchyMapVectors();
    _levels.add(allChannelsLevel);
    _levColumns.add("GLOBAL.CHANNEL_DIM.TOTAL_CHANNEL_ID");
    _levels.add(channelLevel);
    _levColumns.add("GLOBAL.CHANNEL_DIM.CHANNEL_ID");
    // Specify the levels for the hierarchy and map them to relational columns.
    this.createHierarchyMap(chanRollupHier, _levels, _levColumns);
    * Create the Short_Description Attribute for a Dimension.
    public Attribute createShortDescAttr(Dimension dim)
    Attribute sdAttr = dim.createAttribute();
    sdAttr.setName("Short_Description");
    sdAttr.setClassification("MEMBER_SHORT_DESCRIPTION");
    return sdAttr;
    * Creates an AttributeProjection for a Level and sets the name and the
    * Attribute to project onto the Level.
    public void setupAttributeProjection(Level _lev, String _name, Attribute _attr)
    AttributeProjection _ap = _lev.createAttributeProjection();
    _ap.setName(_name);
    _ap.setAttribute(_attr);
    * Creates the associations between Level objects and a Hierarchy.
    public void createHierarchyMap(Hierarchy _hier, Vector _levels, Vector columns)
    int i = 0;
    for(Iterator _lev = _levels.iterator(); _lev.hasNext();)
    Level _curLev = (Level)_lev.next();
    HierarchyLevelAssociation _hla = _hier.createHierarchyLevelAssociation();
    _hla.setLevel(_curLev);
    DimensionMapGroup _dmg = _hla.createSourceDimensionMapGroup();
    DimensionKeySourceExpression _dkse = _dmg.CreateKeyMap();
    SourceColumn _levColumn = _dkse.CreateSourceColumn();
    _levColumn.setColumn((String)columns.elementAt(i));
    // The first level has no parent.
    // Each subsequent level does have a parent.
    // The first element in the Vector must be the top-most level.
    if (i > 0)
    HierarchicalParentSourceExpression _hpse = _dmg.CreateParentMap();
    SourceColumn _hpsesc = _hpse.CreateSourceColumn();
    _hpsesc.setColumn((String)columns.elementAt(i-1));
    i++;
    * Clears the Vector objects that are used for specifying the Level objects
    * in a Hierarchy and for mapping the levels to the columns of a relational
    * table.
    public void clearHierarchyMapVectors()
    _levels.removeAllElements();
    _levColumns.removeAllElements();
    * Clears the Vector objects that are used for mapping a Level object to the
    * columns of a relational table.
    public void clearLevelMapVectors()
    _keys.removeAllElements();
    _cols.removeAllElements();
    * Creates a DimensionMapGroup that maps a Level to the columns of
    * a relational table.
    public void createLevelMap(Level _lev, Vector _keys, Vector _columns)
    // Map the keys of the relational table to the level.
    DimensionMapGroup _dmg = _lev.createSourceDimensionMapGroup();
    DimensionKeySourceExpression _key = _dmg.CreateKeyMap();
    for (int y=0; y < _keys.size(); y++)
    SourceColumn _keycol = _key.CreateSourceColumn();
    _keycol.setColumn((String)_keys.elementAt(y));
    // Map the columns of the relational tables or views to the
    // AttributeProjection objects.
    int i = 0;
    for(Iterator attrs = _lev.getAttributes().iterator(); attrs.hasNext();)
    AttributeProjection _curAttr = (AttributeProjection)attrs.next();
    AttributeSourceExpression _attrMap = _dmg.CreateAttributeMap();
    _attrMap.setTargetObject(_curAttr);
    SourceColumn _attrCol = _attrMap.CreateSourceColumn();
    _attrCol.setColumn((String)_columns.elementAt(i));
    i++;
    * Clears the Vector objects that are used for specifying the Level objects
    * in a Hierarchy and for mapping the levels to the columns of a relational
    * table.
    public void clearCubeMapVectors()
    _measures.removeAllElements();
    _measCols.removeAllElements();
    _levels.removeAllElements();
    _cols.removeAllElements();
    _dimList.removeAllElements();
    * Specifies the dimensions for a Cube.
    public void associateCubeDimensions(Cube _cube, Vector _dimList)
    for (int i=0; i < _dimList.size(); i++)
    CubeDimRef _cdr = _cube.createCubeDimRef();
    Dimension _dim = (Dimension)_dimList.elementAt(i);
    _cdr.setDimension(_dim);
    * Maps the columns of the relational tables to the dimensions and measures
    * of the analytic workspace Cube.
    public void createCubeMap(Cube _cube, Vector _levels, Vector _columns,
    Vector _measures, Vector _measCols)
    CubeMapGroup _cmg = _cube.createSourceCubeMapGroup();
    // Create the primary key in the fact table.
    for (int y=0; y < _levels.size(); y++)
    CubeDimensionSourceExpression _cdse = _cmg.CreateKeyMap();
    _cdse.addLevel((Level)_levels.elementAt(y));
    // Loop through the associated comma delimited
    // FKey columns in the fact table.
    StringTokenizer _st =
    new StringTokenizer((String)_columns.elementAt(y), "," );
    while (_st.hasMoreTokens())
    SourceColumn _keycol = _cdse.CreateSourceColumn();
    _keycol.setColumn(_st.nextToken());
    for(int x=0; x < _measures.size(); x++)
    Measure curMeasure = (Measure)_measures.elementAt(x);
    curMeasure.setAutoSolve("NO_AUTO_SOLVE");
    String curMeascol = (String)_measCols.elementAt(x);
    MeasureSourceExpression _measMap = _cmg.CreateAttributeMap();
    _measMap.setTargetObject(curMeasure);
    SourceColumn _meascol = _measMap.CreateSourceColumn();
    _meascol.setColumn(curMeascol);
    * Specifies excluding NA values when computing values while building the
    * analytic workspace.
    public void precomputeNA(Cube _cube, String _aggdef_name)
    // Rename the default aggregation definition that was implicitly created.
    AggregationDefinition _aggdef =_cube.getDefaultAggregationDefinition();
    _aggdef.setName(_aggdef_name);
    // Remove the default calculation specification.
    _aggdef.getCalculationSpecification().clear();
    Vector _dimrefs = _cube.getCubeDimRefs();
    for (Iterator _d = _dimrefs.iterator(); _d.hasNext();)
    AggregationHierarchySpecification _aggHierSpec =
    _aggdef.createAggregationHierarchySpecification();
    CubeDimRef _dimref = (CubeDimRef)_d.next();
    Dimension _dim = _dimref.getDimension();
    _aggHierSpec.setDimension(_dim);
    PreComputeClause _precompute_clause =
    _aggHierSpec.createPreComputeClause();
    DimensionMemberExpression _dimMemExp =
    _precompute_clause.createDimensionMemberExpression();
    _dimMemExp.setExpression("ALL");
    _dimMemExp.setExpressionType("EXCLUDE");
    * Deletes the analytic workspace if it already exists.
    private void deleteExistingAW(AWConnection awConnection, String user,
    String awName)
    try
    OracleConnection conn = (OracleConnection)
    awConnection.getSQLConnection();
    SPLExecutor splExec = new SPLExecutor(conn);
    splExec.initialize();
    try
    System.out.println("Deleting " + user + "." + awName + " if it exists.");
    splExec.executeCommand("aw delete " + user + "." + awName);
         // System.out.println("Deleted " + user + "." + awName + ".");
    catch(Exception e)
    // System.out.println("The " + user + "." + awName + " analytic workspace "
    // + "either did not exist or it could not be deleted.");
    catch(SQLException e)
    System.out.println("Could not initialize the SPL executor. " + e);
    private String getConnectionProperty(Properties props)
    String conn = props.getProperty("conn");
    if (conn == null)
    String url = props.getProperty("url");
    if (url.indexOf("@") > 0)
    conn = url.substring((url.lastIndexOf("@") + 1), url.length());
    props.put("conn", conn);
    return conn;
    public static void main(String[] args)
    new BuildAWExample().execute(args);
    }

  • Sending mails based on hierarchy  by using Oracle Alerts

    Hi All,
    From past five days i am facing problem in Oarcle Alerts that my requirement is i need to send mails based on hierarchy people by uisng oracle alert.
    In this need to send the mail only the different Hierarchy head person only and i need to do this by using alert only
    Can any one please suggest me for this.
    Any help is greatly appreciated.
    Thanks
    Anushka

    Hi,
    i have sql statement Now my problem is how to run 'Sql Statement Script' from Alerts, can you please suggest me on this .I believe this is explained in "Oracle Alert" manual.
    Applications Releases 11i and 12
    http://www.oracle.com/technology/documentation/applications.html
    Thanks,
    Hussein

  • Oracle ADF example of use of Single One Choice with Hierarchy Viewer

    I am using JDeveloper Studio 11.1.2.3.0.
    I am looking for a simple example where one can select a value from a Single One Choice component and have it drive a query
    for populating the Hierarchy Viewer.

    You can just use a VO with parameter as the base of your HV - then drag the executeWithParam operation to the page as a parameter form.
    And possibly add a list or LOV to the parameter.
    https://blogs.oracle.com/shay/entry/adding_an_lov_to_a_query_param
    Instead of the table in the video use the HV.

Maybe you are looking for

  • Power speakers with USB port

    Before I buy a pair of USB speakers, could I power them using the USB port on the airport express then run the 3.5mm cable to them for the music? I'm sure this is a daft question, but I thought I'd check.

  • What's the maximum voltage for each LED on the LED panelette (SC-2345)?

    I need to know whether or not, I can hook up the LED's of the LED panelette on a 15VDC circuit or not.

  • JSP Import Error

    I'm very new to Netweaver, java and JSP, so please forgive me for what is hopefully a very simple question. I've created a simple JSP page that needs 2 external JAR files to run. <%@ page import="org.apache.commons.codec.binary.Base64" %> <%@ page im

  • Number of desktops

    Is there any practical limit to the number of desktops you can create in a portal? For example, can I host 120 customers on one portal site using 120 desktops, or will I run into performance issues, etc.? thanks, Chad

  • Populate combobox2 From database WHERE combobox1.text = something

    I want to populate combobox2 from database WHERE combobox1.text = something. Here is the code I have and also I am using datable so I want to keep it that way private void cbCompany_SelectedIndexChanged(object sender, EventArgs e)             this.cm