Build a hierarchical structure from a ordered table

Hi guys,
say I have a table A with 3 columns, each column represents a level in a hierarchical structure. Is it possible to make a recursive query (connect by) to retrieve the info in a hierarchically way?
TABLE A.
COL1 COL2 COL3
1 2 3
1 2 4
1 2 5
The tree I want should be something like:
1
2
3
4
5
Thanks for your help!.

Not really, there was a display problem. What happen is that I want to display a tree in Forms based on the info I have in my table, so the tree(implemented with FTREE) has to look like this:
+1
--+2
----3
----4
----5
As you can see, if the table would be with only 2 columns with an pig ear relationship this would be very easy, however my hierarchy of my table is based on the position of the columns:
COL1 father of COL2
COL2 father of COL3
and so on...
My problem is that I don4t know how the query I have to fill in the Data Query property of my tree has to be.
I tried on Forms forum but didn't get any answer, so I hope you sql guys may give a clue, as I know you're very smart in this area.
Thanks for your sooner input.!

Similar Messages

  • Trouble with Frank Nimph Building a hierarchical tree from recursive table

    I copy the example, but when i run it i get the error:
    javax.faces.el.EvaluationException: javax.faces.FacesException: javax.faces.FacesException: Can't instantiate class: 'vuo.view.TreeHandler'.. class vuo.view.TreeHandler : java.lang.ClassCastException: oracle.jbo.domain.Number
    Caused by: java.lang.ClassCastException: oracle.jbo.domain.Number     at vuo.view.TreeHandler.populateTreeNodes(TreeHandler.java:58)
    This is line 58 of TreeHandler.java : employeeNode.setEmployee_id((Number)row.getAttribute("EmployeeId"));
    The problem is that i couldn't import oracle.jbo.domain.Number; like in the files TreeHandler.java and GenericTreeNode.java because when i type import oracle.jbo.domain.Number;on my java classes It doesn't compile, in GenericTreeNode does not recongnize:
    private Number employee_id;
    private Number manager_id;
    private Number salary;
    and in TreeHandler it said Number not found.
    So i comment the import oracle.jbo.domain.Number; on both classes and compile ok, but when i run the page i get the error:
    javax.faces.el.EvaluationException: javax.faces.FacesException: javax.faces.FacesException: Can't instantiate class: 'vuo.view.TreeHandler'.. class vuo.view.TreeHandler : java.lang.ClassCastException: oracle.jbo.domain.Number
    So what can i do?
    Thanks.

    Hi,
    as you copied the code, male sure that your classes import statement has oracle.jbo.Number and not java.lang.Number in it. It seems that you try to cast oracle.jbo.Number to java.lang.Number. Note that oracle.jbo.Number requires the ADF Business Component runtime libraries to be selected for the ViewLayer project (see project libraries)
    Frank

  • Remove Appended Structure from standard table

    Hi Experts,
    I have appended a Z structure to table VBAP.
    I want to remove it now. How can I do?
    Rajiv Ranjan

    Hi Rajiv Ranjan,
    to delete the append structure from the database table, follow the points
    1. Goto se11
    2. enter your append structure name.
    3. press delete
    4. It will delete this append,
    also in the original table/structure
    where it is used, AUTOMATICALLY.
    5.now the data base table VBAP is partially active so
    go to tcode se14 and give the table name and click on EDIT button
    and click on ACTIVATE AND ADJUST button.
    then it will work.
    if it is not possible reply to me.
    regards
    sreenivas

  • Generate xml from non-relational table

    Hi
    I would like to create hierarchical xml from non-relational table as below, can anybody share some idea?
    I have tried the XMLAgg/XmlElement and could not get the desired result. Any help would be greately appreciated.
    create table testing
    ( super_cat varchar2(30)
    , normal_cat varchar2(30)
    , sub_cat varchar2(30)
    , detail varchar2(30));
    CREATE UNIQUE INDEX IDX_TESTING ON TESTING(SUPER_CAT,NORMAL_CAT,SUB_CAT);
    insert into testing values ('SUPER_A','NORMAL_A','SUB_A', 'DETAIL1');
    insert into testing values ('SUPER_A','NORMAL_A','SUB_B', 'DETAIL2');
    insert into testing values ('SUPER_A','NORMAL_B','SUB_A', 'DETAIL3');
    insert into testing values ('SUPER_A','NORMAL_B','SUB_B', 'DETAIL4');
    COMMIT;The result should be like :
    <Document>
    <SuperCategory>
    <SuperCategoryName>SUPER_A</SuperCategoryName>
    <NormalCategory>
    <NormalCategoryName>NORMAL_A</NormalCategoryName>
    <SubCategory>
    <SubCategoryName>SUB_A</SubCategoryName>
    <ResultDetail><Detail>DETAIL1</Detail></ResultDetail>
    </SubCategory>
    <SubCategory>
    <SubCategoryName>SUB_B</SubCategoryName>
    <ResultDetail><Detail>DETAIL2</Detail></ResultDetail>
    </SubCategory>
    </NormalCategory>
    <NormalCategory>
    <NormalCategoryName>NORMAL_B</NormalCategoryName>
    <SubCategory>
    <SubCategoryName>SUB_A</SubCategoryName>
    <ResultDetail><Detail>DETAIL3</Detail></ResultDetail>
    </SubCategory>
    <SubCategory>
    <SubCategoryName>SUB_B</SubCategoryName>
    <ResultDetail><Detail>DETAIL4</Detail></ResultDetail>
    </SubCategory>
    </NormalCategory>
    </SuperCategory>
    </Document>

    user563940 wrote:
    Hi
    I would like to create hierarchical xml from non-relational table as below, can anybody share some idea?
    I have tried the XMLAgg/XmlElement and could not get the desired result. Any help would be greately appreciated.I think you should be able to achieve this with the addition of XMLFOREST.
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/functions244.htm#SQLRF06169

  • Hierarchical data structures (in a single table)

    Hi,
    If I have a hierarchy of objects stored in a table -
    ORG_UNIT
    ID
    PARENT_ID
    NAME
    And the JDO mapping for an OrgUnit contains a parent OrgUnit and a
    Collection of children.
    Is there an efficient way of pulling them out of the database.
    It is currently loading each individual parent's kids.
    This is going to be pretty slow if there are say 500 OrgUnits in the
    database.
    If it would be better to pull them all out and build the hierarchy up in
    code (as it was being done in straight JDBC). How can I efficiently obtain
    the parent or children without doing exactly the same?
    Thanks,
    Simon

    Simon,
    There will be no db access for every child - you will read all child records
    for a particular parent at once when you try to access its child collection.
    Granted that for terminal leaves you will get an db access to load an empty
    collection so effectively you will get a db access per node. If your goal is
    always to load and traverse entire tree it will be expensive. But the
    beauty of hierarchical structures is that while they could be huge millions
    of nodes you do not need to load it all to navigate - just the path you
    need. This is where lazy loading excels so overall on large trees you will
    be much better of not loading whole thing at once. However if you still want
    to do it nothing prevents you from not having persistent collection of child
    records in OrgUnit class at all but only a reference to a parent, load
    entire table using query and then build tree in memory yourself as you
    iterate over the query resultset. You can probably even do it in a single
    iteration over the resultset. I would never do it myself though . In my
    opinion it defeats ease of use and cleanness of your object model.
    Alex
    "Simon Horne" <[email protected]> wrote in message
    news:ag1p9p$9si$[email protected]..
    Hi,
    If I have a hierarchy of objects stored in a table -
    ORG_UNIT
    ID
    PARENT_ID
    NAME
    And the JDO mapping for an OrgUnit contains a parent OrgUnit and a
    Collection of children.
    Is there an efficient way of pulling them out of the database.
    It is currently loading each individual parent's kids.
    This is going to be pretty slow if there are say 500 OrgUnits in the
    database.
    If it would be better to pull them all out and build the hierarchy up in
    code (as it was being done in straight JDBC). How can I efficiently obtain
    the parent or children without doing exactly the same?
    Thanks,
    Simon

  • Table/Structure for process order's auto batch determined component.

    Hi PP Gurus,
    We're struggling to get the Structure/Table name where data pertaining to process order component which is batch managed and automatically batch determined goes. We know RESB is the table where it gets updated after saving Process order. But we want the structure/table name before saving the Released Process order. Can anybody please help to get it?
    Thanks,
    Abu Arbab

    Abuarab,
    I think it will in structure CAUFVD. Following are the enchancements available as of ECC 6.0,
    PPCO0001  Application development: PP orders
    PPCO0002  Check exit for setting delete mark / deletion indicator
    PPCO0003  Check exit for order changes from sales order
    PPCO0004  Sort and processing exit: Mass processing orders
    PPCO0005  Storage location/backflushing when order is created
    PPCO0006  Enhancement to specify defaults for fields in order hea
    PPCO0007  Exit when saving production order
    PPCO0008  Enhancement in the adding and changing of components
    PPCO0009  Enhancement in goods movements for prod. process order
    PPCO0010  Enhancement in make-to-order production - Unit of measu
    PPCO0012  Production Order: Display/Change Order Header Data
    PPCO0013  Change priorities of selection crit. for batch determin
    PPCO0014  Select process orders for external relationships
    PPCO0015  Additional check for document links from BOMs
    PPCO0016  Additional check for document links from master data
    PPCO0017  Additional check for online processing of document link
    PPCO0018  Check for changes to production order header
    PPCO0019  Checks for changes to order operations
    PPCO0020  Process order: Display/change order header data
    PPCO0021  Release Control for Automatic Batch Determination
    PPCO0022  Determination of Production Memo
    PPCO0023  Checks Changes to Order Components
    Regards,
    Prasobh

  • Get the data from a structure not a transparent table

    Hello masters, does anyone knows how to retrieve data from a structure?

    Structures do not contain data, they are mearly a way to describe it and are usually used in screen programming to collect data into which come from transparent tables.  For example, lets say you have data from two tables that need to be displayed on a screen, the data is related, so a good programming practice is to use a structure either described internally in the program, or in the ABAP dictionary.  Then in the program, you retrieve the data from the transpart tables and move the data to the structure fields, these structure fields are then defined within the screen. 
    Anyway, when you do F1 help on a field in a screen, and it is says that it is part of a structure, then this is becasue the structure is being used to group these fields into a common container when doing the screen programming, so it is a little trickier to find where the data is coming from, but not impossible.  One way is to use the ST05 to do a SQL trace on the program, this will tell you the tables being hit, and you can find the data that way.  Another way, is to debug the program, and see where the data is coming from.
    Regards,
    Rich Heilman

  • Table links from Purchase order to condition types

    Hi,
    I am looking for the tables to go from purchase order, and to read the conditions associated with the PO.
    I have EKKO, and EKPO, but I cannot find the table where the condition information is stored. I have KONV and KONP, but they seem to be the tables where the condition type info is stored, not the link table where the purchase order specific information is stored.
    Can somebody please point in the right direction?
    Regards
    Piet
    Edited by: Piet Strydom on May 12, 2009 12:52 PM

    Hi,
    The PO and the Condition Record Number Link happens in the Table EKKI.
    from this table get the condition Record number line item wise and execute in KONV.
    Hope so it helps
    Regards
    Anjanna
    you can check the below thread posted by self for further ing
    Re: PO item Condition Record number and delivery address of PO - Need a table n
    Edited by: Shiva Rajanala on May 12, 2009 1:42 PM

  • It's possible to make Hierarchical Tree from multiple tables ?

    the famous example for Hierarchical Tree is about employee_id and manager_id field in employees table ............ so I was wondering it's possible to make[b] Hierarchical Tree from multiple tables ? and How ??
    if the answer associate with example that will be so kind of you :D
    and thanks in advance.

    HI
    use curose in when new form instance or procedure then u can got data more then one table like that
    DECLARE
    htree ITEM;
    top_node FTREE.NODE;
    new_node FTREE.NODE ;
    child_node ftree.node ;
    item_value VARCHAR2(30);
    cursor prime_cur is select main_desc mgr_name, main_code dept
    from pur_item_group_mst;
    cursor child_cur(v_dept number) is select sub_desc,sub_code
    from pur_item_group_dtl where main_code = v_dept ;
    BEGIN
    htree := Find_Item('tmp.tree4');
    for dummy in prime_cur loop
    new_node := Ftree.Add_Tree_Node(htree,
    ftree.root_node,
    Ftree.PARENT_OFFSET,
    Ftree.LAST_CHILD,
    Ftree.EXPANDED_NODE,
    dummy.mgr_name,
    'D:\ORYX_POLYBAGS\accept',
    dummy.dept);
    for child in child_cur(dummy.dept) loop
         child_node := Ftree.Add_Tree_Node(htree,
    new_node,
    Ftree.PARENT_OFFSET,
    Ftree.LAST_CHILD,
    Ftree.EXPANDED_NODE,
    child.sub_desc||' '||'('||child.sub_code||' '||')',
    'D:\ORYX_POLYBAGS\next',
    child.sub_code);
    end loop;
    end loop;
    END;
    Rizwan Shafiq
    www.rizwanshafiq.blogspot.com

  • Get the Common from Two Internal Tables with same structure

    Hi ,
    I need to get the Common data from Two Internal Tables with same structure with using the looping method.
    For e.g.
    I have two internal table say ITAB1 and ITAB2.
    ITAB1 has values A,B,C,D,E,F
    ITAB2 has values A,H,B,Y,O
    Output at runtime should be : A,B

    Hi mohit,
    1. If u want to compare all fields,
       for matching purpose,
       then we can do like this.
    2.
    report abc.
    data : a like t001 occurs 0 with header line.
    data : b like t001 occurs 0 with header line.
    loop at a.
      LOOP AT B.
        IF A = B.
          WRITE :/ 'SAME'.
        ENDIF.
      endloop.
    ENDLOOP.
    regards,
    amit m.

  • Multiple Hierarchies from Single Dimension Table in OBIEE-11g?

    Is it possible to have Multiple Hierarchies from Single Dimension Table in OBIEE-11g?
    Like 1)Year-Qtr-Month-Weeks 2)Year-Month-Days

    Hi,
    or if your lowest level is the same like
    Day->month->year->Total
    Day->businessMonth->businessyear->Total
    Then yes, it is.
    Create the first, then you start to create the second by adding your top(business year) level on the same level as the one you have (year) both under your total.
    Then when you would add your second base level, there is a special option for it, something like use other hierarchy level/shared level (sorry can't recall and does not have a connection right now) then you select your existing day level under your businessmonth level.
    Hope this helps,
    Regards,
    D

  • Cpying / Importing only a few tables structure from one schema to other!

    Greetings,
    Can any one please suggest me the best method to copy the structure of series of tables from one schema to other in a eased way!
    For example:- There is a MC scheama and there are about 1000 tables... and there is a AB schema where I need to copy only structure of 85 selected tables from MC -> AB..
    Please suggest!

    Hi,
    You could use any of the following:
    1) Export 85 tables from source to destination
    2) Use Data Pump Export with Network_link if you are on 10g
    3) Use CTAS (create table as select )
    4) Use DBMS_METADATA.GET_DDL procedure on the source to create a script
    Probably, others would come up with more bright ideas.
    Regards

  • Returning table structure from Web Service...

    Hi,
    I have a web service which retrieves data from a database table. I want to use this web service from my Visual Composer to display the data on the screen.
    I want to know how to return the table structure from my web service. Currently i am returning a string array (only one row of data) from my web service and displaying it in the VC. But i want to include the names of the columns as well.
    I tried using 2D String[] and HashMap, both didn't work for me.
    Any ideas?
    Regards,
    Venkat

    Hi Venkat,
    I recommend to pass the headers in seperat variables and the data table in a array.
    I did something similar, without the header, because they are fixed in my scenario.
    This webservice returns a list of all Portal Roles:
         public roleModel[] getRoles() throws Exception{
                   // Array List as return value
                   ArrayList RoleList = new ArrayList();
                   // Try Block reading portal roles
                   try {
                        IRoleFactory rfact = UMFactory.getRoleFactory();
                        // Filter for PortalRoles
                        IRoleSearchFilter roleFilter = rfact.getRoleSearchFilter();
                        // Search for *
                        roleFilter.setUniqueName("*", ISearchAttribute.EQUALS_OPERATOR, false);
                        // Search all Roles
                        ISearchResult resultList = rfact.searchRoles(roleFilter);
                        // return the result list
                        if (resultList.getState() == ISearchResult.SEARCH_RESULT_OK) {
                             while (resultList.hasNext()) {
                                  // read roleUid
                                  String roleUid = (String) resultList.next();
                                  // create roleObject for roleUid
                                  IRole roleObject =     rfact.getRole(roleUid);
                                  //  instantiate new role for  ArrayList
                                  roleModel rolle = new roleModel();
                                  // read DisplayName and UniqeID
                                  rolle.setRole(roleObject.getDisplayName());
                                  rolle.setRoleID(roleObject.getUniqueID());
                                  rolle.setDescription(roleObject.getDescription());
                                  // add object to ArrayList
                                  RoleList.add(rolle);
                        // create new array from data type model roleModel (class)
                        // in the correspoding size
                        roleModel[] returnList = new roleModel[RoleList.size()];
                        // write ArrayList back to array
                        RoleList.toArray(returnList);
                        // return all portal roles
                        return returnList;
                   // exception handling
                   } catch (Exception e) {
                        throw new Exception(e);
    Hope that helps!
    Best Regards,
    Marcel

  • Return Table Structure from Web Service...

    Hi,
    I have a web service which retrieves data from a database table. I want to use this web service from my Visual Composer to display the data on the screen.
    I want to know how to return the table structure from my web service. Currently i am returning a string array (only one row of data) from my web service and displaying it in the VC. But i want to include the names of the columns as well.
    I tried using 2D String[] and HashMap, both didn't work for me.
    Any ideas?
    Regards,
    Venkat

    Hi,
    I have a web service which retrieves data from a database table. I want to use this web service from my Visual Composer to display the data on the screen.
    I want to know how to return the table structure from my web service. Currently i am returning a string array (only one row of data) from my web service and displaying it in the VC. But i want to include the names of the columns as well.
    I tried using 2D String[] and HashMap, both didn't work for me.
    Any ideas?
    Regards,
    Venkat

  • How to  access the ORACLE APPS table structures from SAP

    Hi Experts,
        How to  access the ORACLE APPS table structures from SAP? Is it possible from SAP?
    Thanks in advance
    Thomas

    Hi Silviya,
    you can access this database using a technique called DB Multiconnect - sometimes written as multi-connect.
    Search the SAP documentation and notes for this term and you will find how to do it.
    Essentially you configure the remote database connection via transaction DBCON.
    If your SAP system is not running on Oracle you will need to install the db-specific kernel files for Oracle along with the Oracel db client software - SQL*Net.
    Then you can access the Oracle database from ABAP using native-SQL. It works a treat!
    Cheers
    Graham Robbo

Maybe you are looking for