Help me on hierarchy

My database versions is 9.2.0.8.0
I need a help on query the order of child records based on parent record and also i want to update the same
order, if any order of parent record changed like 2 to 3 or 1 to 3, i need to update associated record in inherited child record
and continuous records, if any order effects.
let me explain more clearly in data aspects.
here is my table
create table parent_child_link (pc_link_id number,
                                p_order number(9,4),
                                ch_id varchar2(10),
                                p_id number,
                                parent_p_id number,
                    used_date date,
constraint pk_parent_ch_link primary key (pc_link_id));--insert statements
---Parent
insert into parent_child_link values(201,1,'X101',1,null,'05-JAN-2010');
insert into parent_child_link values(202,2,'Y102',1,null,'05-JAN-2010');
insert into parent_child_link values(203,3,'Z103',1,null,'05-JAN-2010');
insert into parent_child_link values(204,4,'A104',1,null,'05-JAN-2010');
insert into parent_child_link values(205,5,'B105',1,null,'05-JAN-2010');
--child
--Inherited from parent record
insert into parent_child_link values(206,1,'E108',2,null,'15-JAN-2010');
insert into parent_child_link values(207,2,'X101',2,1,'05-JAN-2010');
insert into parent_child_link values(208,3,'Y102',2,1,'05-JAN-2010');
insert into parent_child_link values(209,4,'Z103',2,1,'05-JAN-2010');
insert into parent_child_link values(210,5,'A104',2,1,'05-JAN-2010');
insert into parent_child_link values(211,6,'B105',2,1,'05-JAN-2010');
insert into parent_child_link values(212,7,'C106',2,NULL,'15-JAN-2010');
---data looks like
PC_LINK_ID    P_ORDER CH_ID            P_ID PARENT_P_ID USED_DATE
       201          1 X101                1             05-JAN-10
       202          2 Y102                1             05-JAN-10
       203          3 Z103                1             05-JAN-10
       204          4 A104                1             05-JAN-10
       205          5 B105                1             05-JAN-10
       206          1 E108                2             15-JAN-10
       207          2 X101                2          1  05-JAN-10
       208          3 Y102                2          1  05-JAN-10
       209          4 Z103                2          1  05-JAN-10
       210          5 A104                2          1  05-JAN-10
       211          6 B105                2          1  05-JAN-10
       212          7 C106                2             15-JAN-10If i change the order of existing record in parent record,
update parent_child_link set p_order = 5 where pc_link_id = 204;
update parent_child_link set p_order = 4 where pc_link_id = 205;
INSERT into parent_child_link values (213,6,'ZZ11',1,NULL,'15-JAN-2010');
--Data looks like  for parent record
SQL> select * from parent_child_link where p_id = 1 order by p_order;
PC_LINK_ID    P_ORDER CH_ID            P_ID PARENT_P_ID USED_DATE
       201          1 X101                1             05-JAN-10
       202          2 Y102                1             05-JAN-10
       203          3 Z103                1             05-JAN-10
       205          4 B105                1             05-JAN-10
       204          5 A104                1             05-JAN-10
       213          6 ZZ11                1             15-JAN-10       So, my quesion is how do i query in same order for child records cascading this P_ID =1
with out changing order in chiid record
O/p look this
PC_LINK_ID    P_ORDER CH_ID            P_ID PARENT_P_ID USED_DATE
       206          1 E108                2             15-JAN-10
       207          2 X101                2          1  05-JAN-10
       208          3 Y102                2          1  05-JAN-10
       209          4 Z103                2          1  05-JAN-10
       211          5 B105                2          1  05-JAN-10 -- order changed in parent (update)
       210          6 A104                2          1  05-JAN-10 -- order changed in parent (update)
       213          7 ZZ11                2          1  15-JAN-10 -- New record inserted
       212          8 C106                2              15-JAN-10 -- order changed due to new record (update)and how i do update relative order in child records
--similarly if i insert new record in parent, i need to insert same record in child with appropriate order
and updating remaining records, if orders effects.
advance thx
chaitu
Edited by: user12212962 on Jan 15, 2010 11:02 AM
corrected values in parent_p_id field in sample data instead of 10, it should be 1
Edited by: user12212962 on Jan 15, 2010 11:43 AM

I need to update/insert all next level data, when i'm doing update/insert on main level.
Let say, a new record inserted in the main level p_id = 1, i need to insert same record in next level in appropriate position.
same thing for updated record in main level
help me on logic, how to write the code for this, i get all these update/new record's in PL/SQL table(collection object) from front end JAVA application as input parameter to my procedure.
i get only main level (i.e. p_id = 1) transaction records. based on these records, if any next level exists in that table, i need to update/insert records in these next levels as well as main level,
else need to update only main_level.
i've simple logic for processing main_level, but for next level how do i write logic
procedure process_parent_child_link(v_parent_child_link IN type_parent_child, status varchar2)
is
begin
for v_rec in v_parent_child_link.first..v_parent_child_link.last loop
      if v_rec.pc_link_id is null then
           --- insert main level
      --check for next levels
     for v1 in (select distinct p_id
                    from parent_child_link
                     start with parent_p_id =v_rec.p_id
                     connect by prior p_id = parent_p_id) loop
       --   insert next level
     end loop;
    else
           --update main level
           for v1 in (select distinct p_id
                    from parent_child_link
                     start with parent_p_id =v_rec.p_id
                     connect by prior p_id = parent_p_id) loop
                   --   update next level
             end loop;
        end if;
      end loop;
     end;

Similar Messages

  • Transaction VB02 - Search help for product hierarchy

    Hi Experts,
    I have a requirement to add a search help for product hierarchy in transaction VB02. Has anybody done this before? I am not able to assign the program & screen to a Z package.
    Thanks,
    Vitz.

    there are already search helps attached to it.. which fields exactly are you talking about?
    try to find BADI for that screen

  • Value help on a published CR do not show the value help as an hierarchy.

    Hello experts,
    we published a CR based on a Bex Query to the BW role and to BOE. The parameters on CR are based on Bex Hierchy variables. If we logon with an SAP User (with SAP_ALL) on Info View/ BI Launch Pad to execute the CR the value help shows the hierarchy correctly.
    + world
      + North Amerika
      + Western Europe
      + Asia
    If we logon on to  Info View / BI launch Pad with a normal SAP Enduser (without SAP_ALL) but with all needed End User Roles the value help shows a flat List....
    World
    North Amerika
    Western Europe
    Asia
    We try to trace this authorization issue but we do not got any clearly results.
    Maybe someone knows the needed authorization Object on BW....?
    Regards Michael

    Hi,
    the authorizations are documented in the installation guide for the SAP Integration Kit and the authorization trace should show it as well
    ingo

  • XSLT Help Request - Building Hierarchy

    Hi everyone,
    We are receiving a file that has the following structure, where fields that start with H are header fields, and fields that start with D are detail fields (like a header and line items in an FI posting).
    H1, H2, H3, D1, D2, D3, D4, D5
    On the first line of the FI posting, the H and the D fields are populated (i.e. contains the header information, and the first line item information).  Then on the next lines, the H fields are all blank, and the D fields are populated.  So like this:
    H1, H2, H3, D1, D2, D3, D4 (for line item 1)
    , , ,D1, D2, D3, D4 (for line item 2)
    The file can also have more than 1 FI posting (i.e. more than 1 Header):
    H1, H2, H3, D1, D2, D3, D4 (for line item 1)
    , , ,D1, D2, D3, D4 (for line item 2)
    H1, H2, H3, D1, D2, D3, D4 (for line item 1)
    , , ,D1, D2, D3, D4 (for line item 2)
    We are trying to map this into a FIDCC1 idoc posting, which looks like this:
    <FIDCCP01>
      <IDOC>
        <Header>
          <H1></H1>
          <H2></H2>
          <H3></H3>
          <Item><D1></D1><D2></D2><D3></D3><D4></D4></Item>
          <Item><D1></D1><D2></D2><D3></D3><D4></D4></Item>
        </Header>
      </IDOC>
      <IDOC>
        <Header>
          <H1></H1>
          <H2></H2>
          <H3></H3>
          <Item><D1></D1><D2></D2><D3></D3><D4></D4></Item>
          <Item><D1></D1><D2></D2><D3></D3><D4></D4></Item>
        </Header>
      </IDOC>
    </FIDCCP01>    
    We can't make this work alone in the concent conversion, so was thinking that this could be done in XSLT.  We have created a data type that contains the fill H and D fields and are taking this into XI no problems, but we are having problems putting it into the hierarchy.  Any help is greatly appreciated.
    Thanks
    Peter

    Here is the input file, top line being the field breakdown
    12222333333334444566666666666666667777777777777777
    1FB0104052007ARP 20000000026590.000000000000000.00
    /////////////////20000000098765.000000000000000.00
    1FB0104052007USD 20000000012345.000000000000000.00
    /////////////////20000000054321.000000000000000.00
    Field 1, when it is a "1", is the start of the header line.  Field 5 will always be a "2", and is the start of the detail line.  Also all null fields are populated with a slash.
    My idea was to take this in all on 1 line where the structure contains both the header and the detail fields, because I wasn't sure if content conversion could do what I wanted.  When I do that, here is the result:
    <?xml version="1.0" encoding="utf-8"?>
    <ns:IFS_MT xmlns:ns="http://xx.com/xi/fin/gl/iams/ifs">
         <Detail>
              <STYPE1>1</STYPE1>
              <TCODE>FB01</TCODE>
              <BLDAT>04052007</BLDAT>
              <WAERS>ARP</WAERS>
              <STYPE2>2</STYPE2>
              <WRBTR>0000000026590.00</WRBTR>
              <DMBE2>0000000000000.00</DMBE2>
         </Detail>
         <Detail>
              <STYPE1>/</STYPE1>
              <TCODE>////</TCODE>
              <BLDAT>////////</BLDAT>
              <WAERS>////</WAERS>
              <STYPE2>2</STYPE2>
              <WRBTR>0000000098765.00</WRBTR>
              <DMBE2>0000000000000.00</DMBE2>
         </Detail>
         <Detail>
              <STYPE1>1</STYPE1>
              <TCODE>FB01</TCODE>
              <BLDAT>04052007</BLDAT>
              <WAERS>USD</WAERS>
              <STYPE2>2</STYPE2>
              <WRBTR>0000000012345.00</WRBTR>
              <DMBE2>0000000000000.00</DMBE2>
         </Detail>
         <Detail>
              <STYPE1>/</STYPE1>
              <TCODE>////</TCODE>
              <BLDAT>////////</BLDAT>
              <WAERS>////</WAERS>
              <STYPE2>2</STYPE2>
              <WRBTR>0000000054321.00</WRBTR>
              <DMBE2>0000000000000.00</DMBE2>
         </Detail>     
    </ns:IFS_MT>
    I am open to changing the file content conversion if there is a better way!
    The desired result is:
    <FIDCCP01>
         <IDOC>
              <E1FIKPF>
                   <TCODE>FB01</TDOCE>
                   <BLDAT>04052007</BLDAT>
                   <WAERS>ARP</WAERS>
                   <E1FISEG>
                        <WRBTR>0000000026590.00</WRBTR>
                        <DMBE2>0000000000000.00</DMBE2>
                   </E1FISEG>
                   <E1FISEG>
                        <WRBTR>0000000098765.00</WRBTR>
                        <DMBE2>0000000000000.00</DMBE2>
                   </E1FISEG>
              </E1FIKPF>
         </IDOC>
         <IDOC>
              <E1FIKPF>
                   <TCODE>FB01</TDOCE>
                   <BLDAT>04052007</BLDAT>
                   <WAERS>USD</WAERS>
                   <E1FISEG>
                        <WRBTR>0000000012345.00</WRBTR>
                        <DMBE2>0000000000000.00</DMBE2>
                   </E1FISEG>
                   <E1FISEG>
                        <WRBTR>0000000054321.00</WRBTR>
                        <DMBE2>0000000000000.00</DMBE2>
                   </E1FISEG>
              </E1FIKPF>
         </IDOC>
    </FIDCCP01>
    Thanks again!
    Peter

  • Help needed on hierarchy in reporting

    Hi All,
      We have a requirement to create variable selection at the first three node levels of a hierarchy in the report. The user should be given the option to directly enter the customer number instead of selecting the hierarchy node from the drop down.
    1
      2
         3
           4
           4
      2
         3
           4
         3
           4
         3
    2
         3
         3
    The requirement is to have 3 variables in the selection screen
    Variable for Node 1, Variable for Node 2 and Variable for Node 3. The user should be able to enter the value directly at any of
    the 3 node levels and view the output. I have already checked the option of hierarchy node variables but I am not able to
    choose on the node for the variable at each level.
    Please provide your suggestions.
    Thanks,
    Biyaz

    Hi,
    I would solve this by creating the hierarchy-nodes as navigatonal-attributes to 0customer.
    You can set a generic DataSource onto the H-Table and check the proper nodes by programming.
    Select the desired hierarchy, check the node level and assign the node to the InfoObject for the node-level.
    You only have to take care with link nodes.
    Thus you will be able to select in the desired way.
    hope that helps
    Sven

  • Help need in hierarchy query

    Hi,
    I need to display the parent child nodes in the hierarchical manner and i need to list the user under their hier name in the same hierarchical structure. table structures are all as follows.
    user table:
    * userid name*
    100 john
    101 shaddy
    102 sandy
    103 Kalinich
    104 king
    105 Teresa
    106 Clinia
    user hier table :
    userid  hier name
    100 node1
    101 node2
    102 node1
    103 node2
    104 parent
    105 node4
    106 node
    hier table:
    id hier name parent_id
    1 parent
    2 node 1
    3 node1 2
    4 node2 2
    5 node3 1
    6 node4 5
    7 node5 5
    o/p :
    104 king
    106 clinia
    100 john
    102 sandy
    103 Kalinich
    101 shaddy
    105 terresa
    even we dont have entry in user hier and user table for node3 we need to display them child users under the "parent" hier name and need to ignore the child nodes which dont have users under them i.e) need to ignore node5 in the output. below is the query which I have tried.
    SELECT NAME,u.name
    FROM user_hier n,hier u,user a
    WHERE a.user_id (+) = u.user_id
    AND u.name (+) = n.name
    START WITH n.name = 'parent'
    CONNECT BY PRIOR n.node_id= n.parent_node_id;
    Help me on this.
    Thanks in advance
    Edited by: Vi on Apr 30, 2012 6:10 AM

    No you haven't. Either post create table statements or set up your data with a WITH clause, something like the following example:
    with USER_TABLE as (
      select 100 userid, 'john' name from dual union all
      select 101 userid, 'shaddy' name from dual union all
      select 102 userid, 'sandy' name from dual union all
      select 103 userid, 'Kalinich' name from dual union all
      select 104 userid, 'king' name from dual union all
      select 105 userid, 'Teresa' name from dual union all
      select 106 userid, 'Clinia' name from dual
    select * from USER_TABLE
        USERID NAME
           100 john
           101 shaddy
           102 sandy
           103 Kalinich
           104 king
           105 Teresa
           106 Clinia
    7 rows selected.

  • Help me on Hierarchy (No replies frm prev threat)

    Hi SDN,
    I have an 0company(IO) - hierarchy which is chosen as (Entire Hierarchy Time dependent). To my understanding the concerned FF 0company_hier.csv - should have 2 additional fields Date-to and Date-from; but it is not there in the actual FF
    Now, i was asked to keep the FF structure in mind; i have to replicate that structure in 0company  which is (Entire Hierarchy Time dependent) in Prod Server.
    Then load the FF to DEV and Test server.
    1) My qn is If entire Hierarchy time dep at IO level is it compulsory that i have to have the dateto and date-frm fields in FF?
    2) Can i change directly in Prd server or i have to change from Dev server
    Any replies appreciated
    Ponts Guaranteed.
    Kind Regards
    Mahesh.N

    answers to your questions:
    Answer 1) If Hier istime dependant, then it is compulsory to have the dateto and date-frm fields in FF as those two fields decide from which time to which time, which data should be used.
    Answer 2) all the changes, it is always suggested to do first in Dev, test the same and once all OK, then transport in Prod.
    Is the FF is on application server?
    Regards
    Pankaj
    Assign pts if helpful

  • Help for Building Hierarchial Organisation chart

    Hi All,
    I need to build organisation chart for my company to display in a web page with basic functionality of zoom-in , zoom-out and expanding and collapsing of nodes. I did some seach on google and found that ADF hhierachial viewer can be used aptly for this purpose. Though I know how to use JDeveloper tool but i am not aware of ADF and hierarchial viewer. Can any tell me how to do that or atleast point me to some link to build organisation chart example app. Or if someone has used some other tool please guide to gather me information and build the chart. This is urgent for my organization.
    Thanks
    Edited by: J2EE_Life on Mar 20, 2012 10:41 PM

    I have never used "ADF and hierarchial viewer" and it is unlikely that anyone in this forum is going to write a tutorial especially for you so Google is your friend. The first hit I found was https://blogs.oracle.com/shay/entry/exploring_the_hierarchy_viewer .

  • Help Needed on Hierarchial Tree

    Hello All
    Can any one tell me how I can check wheather a selected node is a parent node,
    child node or both parent/child node.please help
    Thanks in advance
    Reni P G

    I would try Get_Tree_Node_Parent and check if there is any parent, or maybe better Get_Tree_Node_Property in combination with NODE_DEPTH (Returns the nesting level of the hierarchical tree node.)
    DS

  • Update sql help needed for hierarchy table

    I am trying update the gross qty field based on each unit qty. This is how the table looks.
    slevel | manager | seller |unit_qty | gross qty
    0 | mary | mary | 1 | 1
    .1 | mary | lynn| 3 | null
    .1 | mary | betty | 2 | null
    .1 | mary | alice | 2 | null
    ..2 | alice | susan | 1 | null
    .1 | mary | amy | 4 | null
    I would the table to look like this after the update, with the values
    slevel | manager| seller | unit_qty | gross qty
    0 | mary | mary | 1 | 1
    .1 | mary | lynn| 3 | 3*1 ={color:#ff0000}3{color}
    .1 | mary | betty | 2 | 2*1 ={color:#ff0000}2{color}
    .1 | mary | alice | 2 | {color:#008000}2*1{color} ={color:#ff0000}2{color}
    ..2 | alice | susan | {color:#0000ff}1{color} | {color:#008000}2*1{color}{color:#0000ff}*1{color} ={color:#ff0000}2{color}
    .1 | mary | amy | 4 | 4*1 = {color:#ff0000}4
    {color}
    This is the sql statement I tried to use without sucess.
    update table set gross_qty = unit_qty * ({color:#ff0000}select gross_qty from table{color}
    {color:#ff0000}where manager=seller{color})
    where slevel &gt;0

    Perhaps the old EXP (SUM (LN (n))) trick for calculating the product.
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    SQL> CREATE TABLE seller (
      2     manager VARCHAR2 (5),
      3     seller VARCHAR2 (5),
      4     unit_qty NUMBER,
      5     gross_qty NUMBER);
    Table created.
    SQL> INSERT INTO seller (manager, seller, unit_qty) VALUES (NULL, 'mary', 1);
    1 row created.
    SQL> INSERT INTO seller (manager, seller, unit_qty) VALUES ('mary', 'lynn', 3);
    1 row created.
    SQL> INSERT INTO seller (manager, seller, unit_qty) VALUES ('mary', 'betty', 2);
    1 row created.
    SQL> INSERT INTO seller (manager, seller, unit_qty) VALUES ('mary', 'alice', 2);
    1 row created.
    SQL> INSERT INTO seller (manager, seller, unit_qty) VALUES ('alice', 'susan', 1);
    1 row created.
    SQL> INSERT INTO seller (manager, seller, unit_qty) VALUES ('mary', 'amy', 4);
    1 row created.
    SQL> COMMIT;
    Commit complete.
    SQL> SELECT manager, seller, unit_qty, gross_qty
      2  FROM   seller;
    MANAG SELLE   UNIT_QTY  GROSS_QTY
          mary           1
    mary  lynn           3
    mary  betty          2
    mary  alice          2
    alice susan          1
    mary  amy            4
    6 rows selected.
    SQL> UPDATE seller s1
      2  SET    s1.gross_qty = (SELECT EXP (SUM (LN (s2.unit_qty)))
      3                         FROM   seller s2
      4                         START WITH s2.seller = s1.seller
      5                         CONNECT BY s2.seller = PRIOR s2.manager);
    6 rows updated.
    SQL> SELECT manager, seller, unit_qty, gross_qty
      2  FROM   seller;
    MANAG SELLE   UNIT_QTY  GROSS_QTY
          mary           1          1
    mary  lynn           3          3
    mary  betty          2          2
    mary  alice          2          2
    alice susan          1          2
    mary  amy            4          4
    6 rows selected.
    SQL>

  • Search Help for Hierarchy Node in SAP BW 7.3

    Hi Experts,
    We were previously using SAP BW 7.1 system and we had a table which used to be maintained through SM30 which has a customed search help on one of the fields for a hierarchy object. And it was working perfectly.
    However, one of our systems have just been migrated into 7.3 version and the above functionality is no longer working.
    This is what is happening now:
    - User selects a hierarchy and after selection nothing is being displayed on field on the table.
    We have tried to debug this customed search help in both environments to distinguish what is wrong. We have noted that a standard function module (RRSV_IOBJ_VALUE_OUTPUT) is not behaving similarly. In 7.1 system, the C_T_DATA table is being filled whereby in the 7.3 system, it is empty.
    Do you think this is the issue?
    Please do advise and propose what can be done to make it work. Or any idea on how to create a new search help for a hierarchy node in 7.3?
    Thanks in advance.

    hi,
    one more thing i will like to add here is in BW 7.3 you get a new security admin feature that allows you to make mass changes to authorizations instead of one-by-one. This can be done by cut-and-paste in a worklist, hierarchy nodes, and you can also add users to multiple analysis authorizations.
    The u2018newu2019 authorizations has both the data value and hierarchy restrictions. You can still build using the u201CRSECADMINu201D transaction
    Also make sure that all objects are in the TLIBG library and they will be 'shielded' during the upgrade.
    regards
    laksh

  • Hierarchy node Variable: F4 Help - Not showing Master data values

    Hi,
    We're having some problems trying to display the F4 help of a hierarchy node selection variable, to show the master data values so that it would look more complete for the users during report execution.
    In the RSD1 setting for the info object, under 'Business Explorer' tab, the 'Query Execution Filter Val. Selectn' is set to 'Only Posted Values for Navigation'.
    I thot that we could overwrite this setting at the Query Designer level, but it does not seem to work.
    Even tho in the Query Designer, we have already specified the 'Filter Value Selection During Query Execution' to 'Values in Master Data Table', it does not seem to display the master data values.
    There is no difference in the F4 values being displayed for the hier node variable, before and after the change in Query Designer.
    Could anyone share some tips on other possible solutions to get a hier node selection variable's F4 help to show the master data values, without changing the RSD1 setting at the info object level please ?
    Thanks in advance for your help.
    Regards,
    Femmie.

    Hi,
    Could you please share the steps you have taken to fix the problem?
    We do have a similar problem and for some reason the newly added hierarchy node for 0Profit_ctr is not showing up in the variable selection screen F4 (input selection for query execution). However we can see this node when we display that hierarchy in RSA1. I did try applying the changes recommened by Jerome but unfortunately it didn't work.
    Any help on this would be greatly appreciated.
    Thanks,
    Krish

  • Need HRMS Hierarchy Help

    Hi Community,
    I have Vision Database and I need Help regarding HRMS Hierarchy.
    I am trying to fetch HRMS Hierarchy by front end and also by back end,
    but i couldn't able to find it.
    So please if any one know then help me.
    Thanks and Regards,
    Vishal Waghole

    Check these -
    Re: Organization hierarchy Report
    Re: I need to get the organization Hierarchies
    urgent...on organization and their hierarchies.
    Re: Help with hierarchical query
    https://forums.oracle.com/thread/search.jspa?peopleEnabled=true&userID=&containerType=&container=&q=organization+hierarc…
    Cheers,
    Vignesh

  • Standard Search Help in Custom Search Help

    I've created a Custom Search Help for Product Hierarchy. But when search help window appears, I want to put a standard search help of Product Hierarchy on Product Hierarchy field which is located on Resctricted section. Is that possible? Let me know if there's a way...
    Thank you

    hello ibnu,
    it is not possible i attach a standard search help mara
    no such feature available .

  • PROBLEM WITH HIERARCHICAL QUERY - PLEASE HELP

    I have got three tables :
    CREATE TABLE FIRM
    (FID INTEGER NOT NULL PRIMARY KEY,
    FNAME VARCHAR(40),
    FTYPE VARCHAR(3),
    MASTERID INTEGER );
    CREATE TABLE FACULTY
    (FAID INTEGER NOT NULL PRIMARY KEY,
    FANAME VARCHAR(40),
    FATYPE VARCHAR(3),
    MASTERID INTEGER );
    CREATE TABLE EMPLOYEE
         (EID INTEGER NOT NULL PRIMARY KEY,
    ENAME VARCHAR(20),
    ESURNAME VARCHAR(20),
         EJOB VARCHAR(3),
         MASTERID INTEGER );
    This is a hierarchical tree(or is ment to be, I,m complete rookie ) . Firm can be the root or can be slave to another firm. Faculty can be slave to firm, or to another faculty. Employee can be slave to faculty or to another employee(e.g. boss). This connections are specified by MASTERIDs.
    I need to write a procedure, which parameter would be node ID. It is meant to create a VIEW from this node as if it was a root (view of a subtree).
    I tried CONNECT BY clause but it works only on one table at a time and I have here three tables.
    I completely don,t know how to write it. Please help.

    create view hierarchy as
    select id, master_id, name from table1
    union all
    select id, master_id, name from table2
    union all
    select id, master_id, name from table3
    Then do your connect by query against hierarchy.
    It will not work in 8i (connect by on views not allowed), so you will need to materialize the view.
    Kirill

Maybe you are looking for

  • How to listen to iPod through new tv?

    I'm trying to listen to 80gig, I believe, 5thgen iPod through new LCD tv. I tried RCA to headphone jack, RCA to plug at bottom of iPod, and VGA adapter. Everything gives no signal message on tv, what should I do? I was able to listen through old TVs

  • Downloaded App Doesn't Show in Apps or Elsewhere

    I downloaded Xfinity TV Go to my Ellipsis 7 last week. When I went to use it I could not find it in Apps nor on my desktop. I went to the Play Store to download it again and the buttons read Uninstall and Open. I hit Open and there it was. But the ic

  • How can obtain a row from an attribute

    Hi, i´m doing a smart project and i need only one row, how can obtain it? The row i want obtain it from an attribute. Thanks,

  • Deletion of production orders

    Hi All,            How to delete the production orders in a day from the system

  • PayPal and Live Cycle Forms

    I have a calculated "Total Amount" field on a Live Cycle generated form.  I would like to take that calculated value and export it to our payment pages on PayPal's secure online network.  On our website, we simply add some code to the page and, when