Creating a Hierarchy Viewer query

Hello,
I'm having huge difficulties creating a Hierarchy Viewer Query. I've looked through the source code contained withing the demo, but it seems to require great knowledge regarding the component. I'm using a three-node model, each node grouped within it's parent.
So I created a custom View to be used as a result list for the query and this part is working just fine. I can pick the unique ID for the node I want from the search results when the user selects one, but I don't know how I can make that specific node my "anchor", my "current node", after that.
Since I'm looking for a specific "contact_id" selected from the search results, I think the correct way of doing it is finding it's node on the TreeModel, and then setting it as my current anchor.
Please, any tips, directions or suggestions on how can I go about doing this?
Thanks!!

Hi!
Thanks for the attention, but I've been through all the basic stuff. The HV documentation only teaches the most primitive part of it. I searched all blogs related to HV, all articles I could find, I've meddled with the demo source code and all I can think of, but I couldn't find anyone who would give much insight on the mechanics of the component or how to build a really powerful search engine for it.
As a sugestion for the developer team, it would be great if the query for this component allowed us to specify actions to be performed on all levels of the tree, instead of only the root node, since most of the time people use HV as a multi-root tree.

Similar Messages

  • Hierarchy Viewer query

    Hi ,
    I am using Jdev 11.1.1.7.0 , and I want to use dvt:hierarchyViewer. Most of the examples I searched were of Hierarchy Viewer bounded to EO's based VO's with ViewLinks and Association.
    However, my case is a bit different.. We don't uses EO's instead we use Programmatic VO's and fetch data and show on screen.
    Does anyone know, how to implement Hierarchy Viewer using Programmatic VO's. I am a bit confused for it's <dvt:node type
    I tried implementing it, and found that it is more like TreeTable.. Is It ??
    Please help.
    Thanks in advance.
    -Neha..

    You need to have a viewLink that implements master-detail to populate the hierarchy viewer.
    The binding for it is hierarchical. I would suggest trying it out first with regular VOs to see how the binding looks like, and then apply your own programmatic VOs to it.

  • Programmatically creating Hierarchy Viewer

    Hi All,
    Please advise on creating heriarchy viewer programmatically instead of the creating a databound based viewer.
    Best Regards,
    Ankit Gupta

    Hi Shay,
    Many thanks for the link.
    The underlying database table has the following columns -
    ID, Name, Type, Parent Name, Parent Type.....with primary key on ID.
    I tried creating a VO from this table and a View link mapping Name & Parent Name.
    Using this structure, I created a hierarchy viewer on the page.
    However, during runtime, all the nodes were show individually instead as a hierarchy.
    Based on this scenario, I have some queries to ask -
    1) Is it mandatory to have "Name" column as primary key , with Parent Name as a self referencing foreign key mapping back to Name.
    2) If "Name" cannot be makred as a Primary key, can the hierarchy viewer model can still be achieved using view link or should i opt the programmatic way to create each node.
    Best Regards,
    Ankit Gupta

  • Hierarchy viewer - restart flash player

    Hi,
    I have created a hierarchy viewer to see the connections between customers and when I start the app, the first time I see the hierarchy viewer I can see it correctly, like
    Parent
         Customer (Searched)
             Child
             Child
    but when I want to see other customers hierarchy I can only see the Parent. I have to expand the tree to see the searched customer and, if has them, the childs.
    Is there anyway to, lets say, restart Flash player so it presents the tree like it does initialy?
    Thanks
    I'm using jdev 11.1.1.7.1

    This is the code of my HV.
    <dvt:hierarchyViewer id="hv1" var="node"
                             value="#{bindings.ProfileRoot1.treeModel}"
                             selectionListener="#{bindings.ProfileRoot1.treeModel.makeCurrent}"
                             layout="hier_vert_top"
                             levelFetchSize="#{bindings.ProfileRoot1.rangeSize}"
                             styleClass="AFStretchWidth"
                             summary="Family Members" displayLevelsAncestor="0"
                             nodeSelection="multiple" displayLevelsChildren="2"
                             partialTriggers="cl2"
                             dontPersist="#{bindings.ProfileRoot1}#{bindings.ProfileRoot1Iterator}">
          <dvt:link linkType="orthogonalRounded" id="l3"/>
          <dvt:node type="view.tree.ProfileRoot view.tree.ProfileRootChilds view.tree.ProfileRootChildsChilds"
                    width="233" height="330" id="n4" showExpandChildren="true"
                    shape="roundedRect"
                    inlineStyle="background-color:#{node.Recid==bindings.Recid.inputValue? ( pageFlowScope.ProfileFamilyMemberBean.defaultNodeColor) :''};
                                 border-color:#{pageFlowScope.ProfileFamilyMemberBean.defaultNodeColor}; border-style:solid; border-width:3px;">
            <f:facet name="zoom100">
              <af:panelGroupLayout styleClass="AFStretchWidth AFHVNodeStretchHeight AFHVNodePadding"
                                   layout="vertical" id="pgl45">
                <af:panelGroupLayout layout="horizontal" id="pgl48">
                  <af:panelGroupLayout id="pgl52">
                    <af:image source="/render_image?id=#{node.Recid}&amp;typ=101"
                              styleClass="AFHVNodeImageSize75" id="i12"/>
                  </af:panelGroupLayout>
                  <af:spacer width="5" height="5" id="s25"/>
                  <af:panelGroupLayout layout="vertical" id="pgl50">
                    <af:panelGroupLayout id="pgl1" layout="vertical"
                                         halign="right"
                                         valign="top" styleClass="AFStretchWidth"/>
                    <af:outputText value="#{node.Salutation}" id="ot32"/>
                    <af:commandLink id="cl1"
                                    actionListener="#{pageFlowScope.ProfileFamilyMemberBean.DisplayNodeInformation}"
                                    styleClass="AFHVNodeTitleTextStyle"
                                    text="#{node.FullNameDisplay}"/>
                    <af:outputText value="#{node.Recid}" id="ot18" visible="false"/>
                    <af:outputText value="#{node.Parentid}" id="ot9"
                                   visible="false"/>
                    <af:panelLabelAndMessage label="#{viewcontrollerBundle.MOBILE_NO}"
                                             id="plam2">
                      <af:outputText value="#{node.Mobile}" id="ot12"/>
                    </af:panelLabelAndMessage>
                    <af:panelLabelAndMessage label="#{viewcontrollerBundle.EMAIL}"
                                             id="plam3">
                      <af:outputText value="#{node.Email}" id="ot16"/>
                    </af:panelLabelAndMessage>
                    <af:commandLink text="commandLink 1" id="cl2"
                                    actionListener="#{pageFlowScope.ProfileFamilyMemberBean.NodeInformation}"
                                    visible="#{node.Recid ne bindings.Recid.inputValue}"
                                    partialSubmit="true"/>
                  </af:panelGroupLayout>
                </af:panelGroupLayout>
                <af:spacer height="5" id="s24"/>
                <dvt:panelCard effect="slide_horz" styleClass="AFHVNodePadding"
                               id="pc7">
                  <af:showDetailItem text="Profile Information" id="sdi14">
                    <af:panelFormLayout styleClass="AFStretchWidth AFHVNodeStretchHeight AFHVNodePadding"
                                        id="pfl15">
                      <af:panelLabelAndMessage label="#{viewcontrollerBundle.MEMBER_NO}"
                                               id="plam4">
                        <af:outputText value="#{node.Membershipnumber}" id="ot3"/>
                      </af:panelLabelAndMessage>
                      <af:panelLabelAndMessage label="#{viewcontrollerBundle.NATIONALITY}"
                                               id="plam5">
                        <af:outputText value="#{node.NationalityDisplay}"
                                       id="ot44"/>
                      </af:panelLabelAndMessage>
                      <af:panelLabelAndMessage label="#{viewcontrollerBundle.DATE_OF_BIRTH}"
                                               id="plam6">
                        <af:outputText value="#{node.BirthdayDisplay}" id="ot45"/>
                      </af:panelLabelAndMessage>
                      <af:panelLabelAndMessage label="#{bindings.ProfileRoot1.hints.Assocno.label}"
                                               id="plam7">
                        <af:outputText value="#{node.Assocno}" id="ot46"/>
                      </af:panelLabelAndMessage>
                      <af:outputText value="#{node.Pmsid}" id="ot36">
                        <af:convertNumber groupingUsed="false"
                                          pattern="#{bindings.ProfileRoot1.hints.Pmsid.format}"/>
                      </af:outputText>
                    </af:panelFormLayout>
                  </af:showDetailItem>
                  <af:showDetailItem text="Profile Information 2" id="sdi15">
                    <af:spacer height="2" id="s22"/>
                    <af:panelFormLayout styleClass="AFStretchWidth AFHVNodeStretchHeight AFHVNodePadding"
                                        id="pfl16">
                      <af:outputText value="#{node.StatusEdit}" id="ot8"
                                     visible="false">
                        <af:convertNumber groupingUsed="false"
                                          pattern="#{bindings.ProfileRoot1.hints.StatusEdit.format}"/>
                      </af:outputText>
                      <af:panelLabelAndMessage label="#{viewcontrollerBundle.CATEGORY}"
                                               id="plam8">
                        <af:outputText value="#{node.Category}" id="ot7"/>
                      </af:panelLabelAndMessage>
                      <af:panelLabelAndMessage label="#{viewcontrollerBundle.TYPE}"
                                               id="plam9">
                        <af:outputText value="#{node.TypeDisplay}" id="ot28"/>
                      </af:panelLabelAndMessage>
                      <af:panelLabelAndMessage label="#{viewcontrollerBundle.SUBTYPE}"
                                               id="plam10">
                        <af:outputText value="#{node.SubtypeDisplay}" id="ot41"/>
                      </af:panelLabelAndMessage>
                      <af:panelLabelAndMessage label="#{viewcontrollerBundle.STARTE_DATE}"
                                               id="plam11">
                        <af:outputText value="#{node.StartDate}" id="ot43">
                          <af:convertDateTime pattern="#{bindings.ProfileRoot1.hints.StartDate.format}"/>
                        </af:outputText>
                      </af:panelLabelAndMessage>
                      <af:panelLabelAndMessage label="#{viewcontrollerBundle.END_DATE}"
                                               id="plam12">
                        <af:outputText value="#{node.EndDate}" id="ot47">
                          <af:convertDateTime pattern="#{bindings.ProfileRoot1.hints.EndDate.format}"/>
                        </af:outputText>
                      </af:panelLabelAndMessage>
                    </af:panelFormLayout>
                  </af:showDetailItem>
                </dvt:panelCard>
              </af:panelGroupLayout>
            </f:facet>
            <f:facet name="zoom75">
              <af:panelGroupLayout styleClass="AFStretchWidth AFHVNodeStretchHeight AFHVNodePadding"
                                   layout="vertical" id="pgl41">
                <af:panelGroupLayout layout="horizontal" id="pgl47">
                  <af:panelGroupLayout id="pgl42">
                    <af:image source="/render_image?id=#{node.Recid}&amp;typ=101"
                              styleClass="AFHVNodeImageSize75" id="i11"/>
                  </af:panelGroupLayout>
                  <af:spacer width="5" height="5" id="s28"/>
                  <af:panelGroupLayout layout="vertical" id="pgl43">
                    <af:outputText value="#{node.Recid}" id="ot11" visible="false"/>
                    <af:outputText value="#{node.Parentid}" id="ot14"
                                   visible="false"/>
                    <af:outputText value="#{node.Salutation}" id="ot40"/>
                    <af:outputText value="#{node.FullNameDisplay}" id="ot4"/>
                    <af:outputText value="#{node.Membershipnumber}" id="ot27"/>
                    <af:outputText value="#{node.NationalityDisplay}"
                                   id="outputText2"/>
                  </af:panelGroupLayout>
                </af:panelGroupLayout>
                <af:spacer height="5" id="s23"/>
                <dvt:panelCard effect="slide_horz" styleClass="AFHVNodePadding"
                               id="pc8">
                  <af:showDetailItem text="Contact " id="sdi16">
                    <af:panelFormLayout styleClass="AFStretchWidth AFHVNodeStretchHeight AFHVNodePadding"
                                        id="pfl13">
                      <af:outputText value="#{node.GenderDisplay}" id="ot5"/>
                      <af:outputText value="#{node.Email}" id="ot17"/>
                      <af:outputText value="#{node.Mobile}" id="ot42"/>
                    </af:panelFormLayout>
                  </af:showDetailItem>
                  <af:showDetailItem text="Address " id="sdi17">
                    <af:spacer height="2" id="s26"/>
                    <af:panelFormLayout styleClass="AFStretchWidth AFHVNodeStretchHeight AFHVNodePadding"
                                        id="pfl14">
                      <af:outputText value="#{node.Category}" id="ot38"/>
                      <af:outputText value="#{node.TypeDisplay}" id="ot39"/>
                      <af:outputText value="#{node.SubtypeDisplay}"
                                     id="outputText3"/>
                    </af:panelFormLayout>
                  </af:showDetailItem>
                </dvt:panelCard>
              </af:panelGroupLayout>
            </f:facet>
            <f:facet name="zoom50">
              <af:panelGroupLayout styleClass="AFStretchWidth AFHVNodeStretchHeight AFHVNodePadding"
                                   layout="horizontal" valign="middle" id="pgl51">
                <af:panelGroupLayout layout="vertical" halign="center"
                                     styleClass="AFStretchWidth" id="pgl49">
                  <af:image source="/render_image?id=#{node.Recid}&amp;typ=101"
                            styleClass="AFHVNodeImageSize50" id="i10"/>
                  <af:spacer height="2" id="s27"/>
                  <af:outputText value="#{node.Recid}" id="ot33" visible="false"/>
                  <af:outputText value="#{node.Parentid}" id="ot22"
                                 visible="false"/>
                  <af:outputText value="#{node.FullNameDisplay}" id="ot19"/>
                  <af:outputText value="#{node.TypeDisplay}" id="ot34"/>
                  <af:outputText value="#{node.SubtypeDisplay}" id="ot24"/>
                  <af:outputText value="#{node.Membershipnumber}" id="ot6"/>
                  <af:outputText value="#{node.Mobile}" id="ot35"/>
                </af:panelGroupLayout>
              </af:panelGroupLayout>
            </f:facet>
            <f:facet name="zoom25">
              <af:panelGroupLayout styleClass="AFStretchWidth AFHVNodeStretchHeight AFHVNodePaddingSmall"
                                   layout="horizontal" valign="middle" id="pgl44">
                <af:panelGroupLayout layout="vertical" halign="center"
                                     styleClass="AFStretchWidth" id="pgl46">
                  <af:outputText value="#{node.Recid}" id="ot23"/>
                  <af:outputText value="#{node.Parentid}" id="ot29"/>
                  <af:outputText value="#{node.FullNameDisplay}" id="ot20"/>
                  <af:outputText value="#{node.Membershipnumber}" id="ot10"/>
                  <af:outputText value="#{node.Category}" id="ot21"/>
                  <af:outputText value="#{node.TypeDisplay}" id="ot37"/>
                  <af:outputText value="#{node.SubtypeDisplay}" id="ot25"/>
                </af:panelGroupLayout>
              </af:panelGroupLayout>
            </f:facet>
          </dvt:node>
        </dvt:hierarchyViewer>

  • Hierarchy viewer - settings

    I have created a hierarchy viewer to present family relation, like family tree, and I can show it with all the settings in the first time, but after that it only presents me one node, instead of the all tree, Parent - Search profile - Childs.
    How can I return the hierarchy viewer with the same configurations used in the first time?
    I'm using jdev 11.1.1.7.1
    Thanks in advance

    What I'm trying to do is present the similar to the family tree.
    For e.g. I'm searching for a profile (A), that profile has a 'ParentId' that will connect to another profile (B) and there are other profiles that as the searched profile (A) as their parent (C, D, E), so the tree will be like this
        B
        A
    C D E
    The first time it shows me the tree I'll see it correctly, but after I change the searched profile, I can only see the Parent (B), the rest of the nodes (A, C, D, E) I have to click the option to present them.
    What I need is to present the tree everytime in the same way.
    Any ideas?

  • How to create a triangle view with a select query?

    I need help to build a select query that will create a triangle view.
    Below is the table I have to query
    *{color:#ff0000}INITIAL TABLE{color}*
    *{color:#008000}AMOUNT | TRANSACTION_DATE | OPEN_DATE | TYPE{color}*
    5 | 30-JAN-09 | 10-JAN-09 | A
    10 | 12-JAN - 09 | 30-NOV-08 | A
    20 | 30 - DEC - 08 | 15-OCT-08 | A
    10 | 30 - DEC - 08 | 8 - OCT - 08 | A
    *{color:#ff0000}THE FINAL TABLE I HAVE TO CREATE:{color}*
    DEV_PERIOD - TO_CHAR(TRUNC(TRANSACTION_DATE,'Q'),'YYYY-Q') AS DEV_PERIOD
    OPEN PERIOD - TO_CHAR(TRUNC(OPEN_DATE,'Q'),'YYYY-Q') AS OPEN_PERIOD
    {color:#008000}*SUM of AMOUNT | DEV_PERIOD | OPEN_PERIOD | TYPE*{color}
    5 | 2009 - 1 | 2009 - 1 | A
    40 | 2009 - 1 | 2008 - 4 | A
    30 | 2008 - 4 | 2008 - 4 | A
    {color:#ff0000}*This is another view of the table (The triangle view)*{color}
    | Dev_Period 2008- 1 | 2008 - 2| 2008 -3 | 2008 - 4 | 2009 -1 |
    Open_Period |
    2008 - 1..................... 0.......... 0............ 0........... 0.......... 0
    2008 - 2 ..................................0............ 0........... 0.......... 0
    2008 - 3................................................. 0........... 0.......... 0
    2008 - 4 ..............................................................30......... 40
    2009 - 1 .............................................................................5
    Any ideas will be appreaciated.
    Thank you!

    I think the first thing you need to do is look up "pivot query" in this newsgroup. And how complicated your query gets to be will depend on your database version (11 natively supports pivot queries). You have a variable number of columns in your result set (depending on how many quarters you have in your data.
    I think once you get the columns sorted out, working out the numbers to put in each column will be relatively easy.
    Jon

  • How to create a tree view to show hierarchy

    Hi all,
    i am new in plugin development.i need help in creating a tree view to show hierarchy.i gone through sdk\paneltreeview example.but not getting clear idea how to create child node.and how to display it..i want to create a simple tree view which displays my custom data as root\child in hierarchy as i want.
    thanks..

    I did this in CS3 a few weeks ago...
    1. subclass NodeIDClass to create your node id class.
    2. subclass ITreeViewHierarchyAdapter to create the adapter
    3. subclass CTreeViewWidgetMgr
    4. in your .fr file, define two "Class"'es based on kTreeViewWidgetBoss (with Interface IID_ITREEVIEWWIDGETMGR and IID_ITREEVIEWHIERARCHYADAPTER) and kTreeNodeWidgetBoss.
    Btw, I put down "persistentlistui" in my note so I guess I looked at that sample instead of the paneltreeeview.
    Good luck.

  • Creating a hierarchy based on a remote database link

    I am trying to create a hierarchy based on a synonym for a remote database table. The hierarchy wizard works correctly, and the table columns do appear as choices in the drop boxes. However, when I try to run the application, I get the error "No data found. This data does not exist or you do not have privileges to view it". Does anyone know how to resolve this error? Or how to work around this?
    I can successfully create and query a form based on the remote table. And, I am able to create a hierarchy from other tables (which do not use a database link) without a problem.
    Thanks for your help!

    This is the query which I am using to build a report
    SELECT
    rollup_timestamp "Date",
    max(decode(target_guid,'199F0B201A3D71A63040BADFAA4F9E90',average,0)) host1,
    max(decode(target_guid,'3FB1329F59339C07E11304B69DC4E594',average,0)) host2
    FROM "sysman.MGMT$METRIC_DAILY"
    WHERE
    (target_guid='199F0B201A3D71A63040BADFAA4F9E90'
    or
    target_guid='3FB1329F59339C07E11304B69DC4E594')
    AND
    metric_name='Load'
    AND
    metric_column='memUsedPct'
    AND
    rollup_timestamp >= to_date('01-10-2009','dd-mm-yyyy') and rollup_timestamp <= sysdate
    GROUP BY rollup_timestamp
    ORDER BY "Date"
    And for your previous question I couldn't even create a page.
    Regards
    Balaji
    Edited by: user7290747 on 6/01/2010 16:17

  • Three levels hierarachy - hierarchy viewer data visualization component

    I am not getting the third level when i am using the hierarchy viewer....any pointers will be a great help
    Edited by: Deepak Subramanian on Jan 22, 2010 5:34 AM

    oops sorry if i sounded vague....
    using jdev version 11g
    well I am trying to use the hierarchy viewer data visualization component to create a hierarchy which shows the managers and employees below them.
    am using a single query based VO which has two columns manager and employee.
    then created a self view link with that vo
    the data control looks something like
    manager(first level)
    ----manager or employee(first level)
    ---------employee(third level)
    I am dragging entire data control on the page so that the create hierarchy viewer option appears.
    from there I am stuck...
    when I am running the page, I am getting just two levels...the last level is not showing up :(.....
    Edited by: Deepak Subramanian on Jan 22, 2010 5:35 AM

  • VIEW Query Problem

    Hi Greg,
    I had created a view on a table which doesn't have Primary Key, but it has Unique and Not Null constraints on required columns.
    I had wrote a procedure to query the data on VIEW. I have experienced strange problem, very first call to procedure will take more time than succeeding requests. For example from second request onwards, it returns data in < 2 Sec, but first transaction is taking 12 Sec to 30 Sec.
    I thought that very first time VIEW is taking time to refresh it self. So, I added FORCE keyword in CREATE VIEW stattement. However, that doesn't helped out.
    In my further investigation I came to know that base table on which VIEW created, has to be loaded in to memory before querying on VIEW.
    So, I had executed a simple select statement on base table, before I execute VIEW query in procedure.
    With this change I got results consistently < 2 Sec all the times.
    My question is instead of executing the select statement on base table is there a way to load base tables data in memory before querying on VIEW?
    Thanks,
    Subbarao

    Hi,
    A view is nothing but parsed SQL statements stored in the database, a view may or may not run faster. If you execute the SQL used to define the view how much time is it taking. If you want try looking at MATERIALIZED VIEW , that may help you.
    thanks

  • Reg: fetch the data by using item_id which is retuned by In line View Query

    Hi all,
    create table xxc_transactions(type_id number,trx_line_id number ,item_id number,org_id number);
    insert into xxc_transactions values(null,null,null,null);
    create table xxc_items1(item_id number,org_id number,item_no varchar2(10));
    insert into xxc_items1 values(123,12,'book');
    create table xxc_headers(header_id number,order_id number);
    insert into xxc_headers values(null,null);
    create table xxc_lines(header_id number,item_id number,line_id number);
    insert into xxc_lines values(null,null,null);
    create table xxc_types_tl(transaction_id number,NAME varchar2(10));
    insert into xxc_types_tl values(106,'abc');
    create table xxc_quantity(item_id number);
    insert into xxc_quantity values (123);
    create table xxc_quantity_1(item_id number);
    insert into xxc_quantity_1 values (123);
    SELECT union_id.item_id,
           b.org_id,
           e.name,
           fun1(union_id.item_id) item_no
    FROM   xxc_transactions a,
           xxc_items1 b,
           xxc_headers c,
           xxc_lines d,
           xxc_types_tl e,
           (SELECT item_id
            FROM   xxc_quantity
            WHERE  item_id = 123
            UNION
            SELECT item_id
            FROM   xxc_quantity_1
            WHERE  item_id = 123
            UNION
            SELECT item_id
            FROM   xxc_transactions
            WHERE  item_id = 123) union_id
    WHERE  a.type_id = 6
           AND a.item_id  = b.item_id
           AND union_id.item_id = b.item_id
           AND a.org_id = b.org_id
           AND c.header_id = d.header_id
           AND d.line_id = a.trx_line_id
           AND d.item_id = b.item_id
           AND c.order_id = e.transaction_id
           AND b.org_id = 12
    GROUP  BY union_id.item_id,
              b.org_id,
              e.name
    ORDER  BY union_id.item_id;
    create or replace function fun1(v_item in number)
    return varchar2
    is
    v_item_no
    Begin
       select item_no from xxc_items1
       where item_id=v_item;
       return v_item_no ;
        Exception
         When Others Then
          v_item_no := null;
          return v_item_no;
    END fun1;
    I  need  fetch the data by using item_id which is retuned by In line View Query(UNION)
    item_id  org_id  name    item_no
    123        12        abc       book
    Version: 11.1.0.7.0  and 11.2.0.1.0
    Message was edited by: Rajesh123 Added test cases script
    Message was edited by: Rajesh123 changed Question as fetch the data by using item_id which is retuned by In line View Query(UNION)

    Hi Master , sorry for the late reply and can you please help on this?
    create table xxc_transactions(type_id number,trx_line_id number ,item_id number,org_id number);
    insert into xxc_transactions values(null,null,null,null);
    create table xxc_items(item_id number,org_id number,item_no varchar2(10));
    insert into xxc_items values(123,12,'book');
    create table xxc_headers(header_id number,order_id number);
    insert into xxc_headers values(null,null);
    create table xxc_lines(header_id number,item_id number,line_id number);
    insert into xxc_lines values(null,null,null);
    create table xxc_types_tl(transaction_id number,NAME varchar2(10));
    insert into xxc_types_tl values(106,'abc');
    create table xxc_uinon_table(item_id number);
    insert into xxc_types_tl values(123);
    SELECT   union_id.item_id,
             b.org_id ,
             e.name ,
             fun1(union_id.item_id) item_no   --> to get item_no
             FORM xxc_transactions a,
             xxc_items             b,
             xxc_headers           c,
             xxc_lines             d,
             xxc_types_tl          e,
             ( SELECT item_id
                 FROM   xxc_uinon_table ) union_id
    WHERE    a.type_id= 6
    AND      a.item_id = b.item_id
    AND      union_id.item_id = b.item_id
    AND      a.org_id = b.org_id
    AND      c.header_id = d.header_id
    AND      d.line_id= a.trx_line_id
    AND      d.item_id= b.item_id
    AND      c.order_id= e.transaction_id ---106
    AND      b.org_id = 12
    GROUP BY union_id.item_id,
             b.org_id ,
             e.name
    ORDER BY union_id.item_id;
    Note: xxc_uinon_table is a combination of UNION's
    select 1 from dual
    union
    select 1 from dual
    union
    select no rows returned  from dual;
    I will get 1 from the above Query
    Thank you in advanced

  • A quicker way to create a materialized view?

    Hi,
    I'm new to replication and have been reading doco on it. Basically I want to set up read-only materialized views in oracle 11g.
    So on the replicated database I created a db link that points to the master db.
    Then I created a materialized view that does "select * from table@dblink" and that is forced refresh every 10 minutes.
    Problem is that the table on the master db is large and the network link is slow, so the "create materialized view" statement would take a long time to complete.
    So I think to speed up the process I would export/import the table from master to replicated db, then make this imported table a materialized view somehow.
    Is this possible, and if so, how?
    Thanks.
    Long

    If you are able to use other means (exp-imp, expdp/impdp, unload-sqlldr, externalfile etc) to copy the data faster (as a normal table in the target database), you can then use the "ON PREBUILT TABLE" clause in the CREATE MATERAILIZED VIEW statement.
    See
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_6002.htm#i2063793
    Alternatively, you must first verify if the CREATE is slow only because of SQL Query performance on the source, rather than because of network bandwidth/latency. If query execution needs to be tuned, that would be a cleaner solution, because the Refresh can then be automatically handled by Oracle.
    Remember that you can use Materialized View Log(s) on the source tables to enable FAST Refresh's as well.

  • Create a Dates View

    Hi gurus, my first question here.:-)
    My DBA gave me a table with only one date column say Table1.Date. Its in the format of Date and say it is = 7/23/2012.
    Now i have to create my own Reporting View(which is used for reporting) based on that date column like below:
    It should be a column with values in the following format =
    2012-07
    2012-06
    2012-05 etc....upto
    2010-01
    So i started out my creating like this:
    select
    to_char(Table1.Date,'yyyy-mm')
    from Table1
    Union
    select SUBSTR(to_char(Table1.Date,'yyyy-mm'), 1,5)||TO_CHAR(SUBSTR(to_char(Table1.Date,'yyyy-mm'), 6, 2)-1)
    from
    Table1
    Union
    select SUBSTR(to_char(Table1.Date,'yyyy-mm'), 1,5)||TO_CHAR(SUBSTR(to_char(Table1.Date,'yyyy-mm'), 6, 2)-2)
    from
    Table1
    etc
    .and so on till i get 2010-01.
    I was wondering, there has to be a better way to do this. Any sugguestions please?
    Thanks,
    Brawn

    Hi,
    Welcome to the forum!
    Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved.
    Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    Always say which version of Oracle you're using, e.g. 10.2.0.4.0.
    See the forum FAQ {message:id=9360002}
    An example of some sample data in your case might be:
    CREATE TABLE  table1
    (       date_column     DATE
    INSERT INTO table1 (date_column) VALUES (TO_DATE ( '7/23/2012', 'MM/DD/YYYY'));
    INSERT INTO table1 (date_column) VALUES (TO_DATE ( '7/20/2012', 'MM/DD/YYYY'));
    INSERT INTO table1 (date_column) VALUES (TO_DATE ( '7/30/2012', 'MM/DD/YYYY'));
    INSERT INTO table1 (date_column) VALUES (TO_DATE ('04/05/2012', 'MM/DD/YYYY'));
    COMMIT;Do you want a view that has one row per month, starting with the earliest month in table1, and continuing through the latest month in table1?
    If so:
    CREATE OR REPLACE VIEW       all_months
    AS
    SELECT     ADD_MONTHS ( last_month
                 , 1 - LEVEL
                 )               AS a_month
    FROM    (
             SELECT  TRUNC (MIN (date_column), 'MONTH')     AS first_month
             ,         TRUNC (MAX (date_column), 'MONTH')     AS last_month
             FROM    table1
    CONNECT BY     LEVEL <= 1 + MONTHS_BETWEEN ( last_month
                                            , first_month
    ;Given the data I posted above, this query:
    SELECT       TO_CHAR (a_month, 'YYYY-MM')     AS formatted_month
    FROM       all_months
    ORDER BY  a_month
    ;produces this output:
    FORMATTED_MONTH
    2012-04
    2012-05
    2012-06
    2012-07Notice that the view contains row for May and June, even though the table doesn't have any data for those months.
    Edited by: Frank Kulash on Jul 30, 2012 4:53 PM
    Added sample data.

  • Create a new view on Reports section

    I have tried to create a new view on the "Reports" section in SCSM 2012 SP1 and here is my final MP:
    <ManagementPack xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ContentReadable="true" SchemaVersion="1.1" OriginalSchemaVersion="1.1">
    <Manifest>
    <Identity>
    <ID>SG.Report.Library</ID>
    <Version>1.0.0.0</Version>
    </Identity>
    <Name>SG Report Library</Name>
    <References>
    <Reference Alias="System">
    <ID>System.Library</ID>
    <Version>7.5.2905.0</Version>
    <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
    </Reference>
    <Reference Alias="SMReport">
    <ID>Microsoft.SystemCenter.Report.Library</ID>
    <Version>7.5.2905.0</Version>
    <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
    </Reference>
    </References>
    </Manifest>
    <Presentation>
    <Folders>
    <Folder ID="Folder.SGReporting" Accessibility="Public" ParentFolder="SMReport!ServiceManager" />
    </Folders>
    </Presentation>
    <LanguagePacks>
    <LanguagePack ID="ENU" IsDefault="true">
    <DisplayStrings>
    <DisplayString ElementID="SG.Report.Library">
    <Name>SG Report Library</Name>
    <Description />
    </DisplayString>
    <DisplayString ElementID="Folder.SGReporting">
    <Name>SG Reports</Name>
    <Description>Contains SG reports</Description>
    </DisplayString>
    </DisplayStrings>
    </LanguagePack>
    </LanguagePacks>
    <Resources>
    </Resources>
    </ManagementPack>
    I can see the MP is imported successfully, Then I query the DB for folder:
    select * from Folder
    where folderName like '%report%'
    which gives me some rows containing the folder with parentID = '77C85F13-0D2F-5989-F175-781DE54AD627'
    this GUID belongs to "ServiceManager" folder which is the parent folder of "reports" section.
    All goes well without error, yet the folder does not show up!
    I have tried sealing the Mp but still to no avail.
    What I have done wrong?
    YSobhdel

    you have to use the MM01 tocde and enter the mateial you want extend for new view. system will propose the view and select the new view.
    Or use MM50 for mass

  • Creating a Calendar View using alternative date fields

    I have a Sharepoint 2007 calendar list that includes the standard Start and End Date fields.  I also have "Suggested Start Date" and "Suggested End Date" fields that are utilized by users to recommend the Start and End Dates for
    the event.
    I can create a Calendar view that displays the events according to the Start and End dates.
    I cannot create a Calendar view that displays the events according to the Suggested Start and Suggested End date fields.
    In practice, all items are not displayed on this second calendar view that should be displayed even though you can choose these fields as Time Interval values when establishing the calendar.
    Is there a way to create a Calendar View that will use date fields other than the default Start and End date fields?
    Thanks,
    Chris Mang>> JDA Software Group, Inc.

    Hello,
    It seems problem with time value. Have you included time value in custom datatime column wile creating? What happens when you select "date only" from column settings?
    You can also try below suggestion to include "IncludeTimeValue" parameter in CAMl query by designer:
    http://stackoverflow.com/questions/18362853/how-do-i-filter-by-today-and-time-in-sharepoint-list-view
    OR else create two more calculated column and save date only in those columns then filter by them.
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

Maybe you are looking for