Carl's / Scott's Ajax Tree Example Query

Hi,
Hoping someone can assist, I have utilized Carl's and Scott's Ajax tree example, specifically have used the following example from Carl's app, i.e.:
http://apex.oracle.com/pls/otn/f?p=11933:49:4073287192617448::NO:RP::
All is working great but my query is, with the following query, that I am using, i.e.
SELECT "EMP"."MGR" as "MGR",
        "EMP"."EMPNO" as "EMPNO",
        "EMP"."ENAME" as "ENAME" ,
        (select count(*)  from "EMP" "EMP2" where  "EMP2"."MGR" = "EMP"."EMPNO") BranchCount
from
"EMP" "EMP"
where
"EMP"."MGR"  =  :BRANCH_IDI need to also retrieve the LEVEL pseudo-column as well for each record retrieved as I need the LEVEL info for trying to determine at what level of the tree I am at.
I believe you can only use the LEVEL column with a CONNECT BY PRIOR clause.
I would actually like to incorporate the LEVEL column into the above query - is this possible?
If not, can someone pls assist with re-writing the above query using a connect by clause which will still retrieve the same info as Carl's original query.
Thanks.
Tony.

Hello,
Sure just replace the body section of the procedure with something like this.
for c1 in (
select emp_no,emp_name,emp_manager
from emps
order by 2 asc;
     )loop
htp.prn ('<div>' || c1.emp_no || '-' || c1.emp_name || '-' || c1.emp_manager||'</div>');
end loop;
Carl

Similar Messages

  • Tree Level Query

    Dear Sir
    I need a Tree Level Query in looping Condition and examples using Sql Server
    Regards
    Mohamed Usman

    in sql developer like this
    select level, ename ,empno from emp
    start with mgr = 1001
    connect by prior empno=mgr;

  • Need Simple Hierarchical Tree Example

    Can someone e-mail me a simple, working hierarchical tree example, along with what tables i need to insert into the database? Like the car/airplane example, or employee/department example.
    I tried following the instructions in the Introduction to Hierarchical Tree example from metalink, but the tree still does not display on my form, even though the data query is valid. Nothing happens when i click the button.
    I need this pretty urgently, so any help will be appreciated! Thanks! My e-mail is [email protected]

    Thats what i don't understand, you see. There is no query error. I know when there is, because when i type the query wrongly, the error prompts. However, when the query is correct, nothing happens. When i go through in debug mode, it does enter the statement to populate the tree. This is my record group/data query(i tried putting it in both) :
    SELECT initial_level
    ,node_depth
    ,node_label
    ,node_icon
    ,node_data
    FROM MyTreeData
    START WITH node_parent IS NULL
    CONNECT BY node_parent = prior node_data
    This is my populate tree code :
    DECLARE
         htree ITEM;
         top_node FTREE.NODE;
         find_node FTREE.NODE;
    BEGIN
         -- Find the tree itself.
         htree := FIND_ITEM('mytreeblock.mytree');
         -- Populate the tree with data.
         ftree.Populate_Tree(htree);
    END;
    This is the format of data in the database :
    initial_level node_depth node_label node_icon node_data node_parent
    -1 2 Car Null CAR TRANSPORT
    -1 2 Plane Null PLANE TRANSPORT
    0 2 Bike NULL BIKE TRANSPORT
    1 1 Transport NULL TRANSPORT
    0 3 Honda NULL HONDA CAR
    0 3 Boeing 747 NULL 747-400 PLANE
    0 3 Mazda NULL MAZDA CAR
    I hope its not a problem with my Forms program, so i'm hoping that someone can e-mail me a working one to see. I've been reading up on this for a few days already, but i do not know why its not working.
    Thanks for your help again, Kevin! I really appreciate it.

  • Carl's Report Row with Detail Example

    Hi,
    Hoping someone can assist, I am looking at using Carl's "Report Row with Detail" example at:
    http://apex.oracle.com/pls/otn/f?p=11933:1
    The only thing that I am unsure about is that , instead of using the words show comments/hide comments, I would actually like use an image that will toggle, i.e initially have a plus.gif (+) image to expand row and then toggle to a minus.gif (-) image to hide the row.
    Using Carl's example, would really appreciate some help on achieving this. I tried replacing the innerhtml with an image file but had no luck.
    Thanks.
    Tony.

    Hello,
    There you go http://apex.oracle.com/pls/otn/f?p=11933:107 just make sure the images have a plus and a minus in the filename,
    Regards,
    Carl
    blog : http://carlback.blogspot.com/
    apex examples : http://apex.oracle.com/pls/otn/f?p=11933:5

  • Flex Lazy Loading Tree example posted

    Hi, all;
    I've posted a new example to my blog:
    http://flexdiary.blogspot.com/2009/01/lazy-loading-tree-example-file-posted.html
    This example demonstrates
    - Using lazy loading with a Tree component.
    - Using an interface rather than a concrete type to allow the
    LazyDataDescriptor to work with any class that implements
    LazyLoading.
    - An all-actionscript remoting connection
    It also has the PHP files and instructions for creating the
    mySQL database
    that provide the service data.

    "danger42" <[email protected]> wrote in
    message
    news:gkig47$hqu$[email protected]..
    > Very cool!
    Thanks :-)

  • Tree Attributes Query Example is Incorrect

    I have been trying to create a Tree region in Application Express 4.0.2.00.07.
    In the "Tree Attributes" page the exmaple and help text are contradicting, the example is oncorrect whereas the help text is correct.
    This is very frustrating!
    See text:
    Syntax: select status, level, name, icon, id, tooltip, link from ... where ... start with... connect by prior id = pid order siblings by ...
    +1. You must select the columns in the following order (e.g. status, level, name, icon, id, tooltip, link..)+
    +2. Ordering applies the order_by_clause to the siblings of the hierarchy+
    Example:
    select case when connect_by_isleaf = 1 then 0 when level = 1 then 1 else -1 end as status,
    ENAME as title
    NULL  as icon,
    EMPNO as value,
    ENAME as tooltip,
    NULL  as link
    from EMP
    start with MGR is null
    connect by prior EMPNO = MGR
    order siblings by ENAME
    When following the example, I kept getting a javascript error when running the page and when viewing the source it was the ORA error No Data Found.
    Once I noticed the contradiction between point 1 of the Syntax help and the code example I tried using the columns in the Syntax help and the tree started working.
    Given the proximity of these two pieces of boilerplate text it'd be great if it could be made consistent.
    Hopefully this post will help anyone else who encounters this problem.

    And should look into this proper documentation http://docs.oracle.com/cd/E17556_01/doc/user.40/e15517/app_comp.htm#BABBCAEJ

  • Ajaxed Tree

    Hi all,
    I have created a tree which is working as my navigation aid to tabs, it is using following query
    select "PAGE_NO" id,
    "PARENT_PAGE_NO" pid,
    "NAME" name,
    CASE WHEN NAVIGATION = 'Y' THEN 'f?p=&APP_ID.:'||page_no||':&SESSION.::NO::P0_PARENT_TAB:'||PARENT_TAB||'' ELSE null END LINK,
    null a1,
    null a2
    from "#OWNER#"."APEX_PAGES" where page_no not in (select "PAGE_NO" from "#OWNER#"."APEX_USER_PAGES" where "APP_USER"=:APP_USER)
    order by IDENTIFIER
    But my problem is that page even refreshes when i just click its expand or collapse icon. How can i stop page from refreshing when i click expand or collapse button??? The answer is probably AJAX. But i don't know how can i implement ajax in application express. I have seen few examples, such as BUILDING AJAX MEMORY TREE, but was unable to proceed any furthur. Can anyone explain me step by step, how can i implement ajax in my application on the tree.
    Thanks a lot
    Sunil Bhatia

    Hi,
    OK - In my example, page 1 shows the tree but it is defined on page 2.
    To set this up, do the following:
    1 - Create TWO application items (through Shared Components, Application Items):
    G_TREE_ROOT
    TEMP_REQUEST
    2 - Create an Application Computation (through Shared Components, Application Computations):
    Application Item: G_TREE_ROOT
    Computation Point: Before Header
    Computation Type: Static Assignment
    Computation: 7839
    These settings are based on using the EMP table for the test pages - 7839 is KING, the top person in the tree, so I just need to set this value. Adjust these as required for your tree.
    This computation should be conditional on G_TREE_ROOT being NULL - this ensures that this item gets an initial value
    3 - Create a new Page template (through Shared Compenents, Templates) - this should be created "From scratch" rather than as a copy of an existing template. This new template is so that we can output only the contents of a page region rather than an entire page - I call this template "Page Snippet"
    When created, edit it. You only need two settings:
    Header: (enter a space)
    Body: #BOX_BODY#
    The space is required as the Header definition is required. #BOX_BODY# will be replaced by the contents of the region on the page
    4 - Now create a new page in your app. This should be a "Tree" page - in my example, this is page 2.
    The tree's SQL query should be:
    select "EMPNO" id,
           "MGR" pid,
           "ENAME" name,
           null link,
           EMPNO a1,
           'f?p=&APP_ID.:1:&SESSION.::::P1_EMPNO:' || EMPNO A2
    from "#OWNER#"."EMP"On my page 1, I will have a page item (P1_EMPNO) and a report filtered using this value - A2 is going to be used to create a link to populate P1_EMPNO. The link is not set using the normal LINK item.
    The Application Item for the tree needs to be set to G_TREE_ROOT. You should, though, create it as P2_TREE_ROOT to start with and we can change this later
    5 - When the tree page has been created set the page to use your new "Page Snippet" page template
    6 - You must only have one region on this page - this should, of course, be the region containing the tree. As you don't need anything else on the page, including the buttons, delete everything except for the tree region
    7 - On your tree page, add in a new Process:
    Name: P2_SET_REQUEST
    Process Point: On Load - Before Header
    Process:
    BEGIN
    APEX_APPLICATION.G_REQUEST := :TEMP_REQUEST;
    END;8 - Now click on the Tree link in the region to go to the tree's definition.
    Change the tree's Application Item setting to: G_TREE_ROOT
    Then, you need to adjust a number of the settings in the tree's templates:
    Unexpanded Parent:
    &lt;td&gt;
    &lt;a href="#" onclick="javascript:getTree('EXPAND,#A1#');"&gt;
      &lt;img src="#IMAGE_PREFIX#Fndtre02.gif" width="16" height="22" border="0"&gt;
    &lt;/a&gt;
    &lt;/td&gt;Unexpanded Parent Last:
    &lt;td&gt;
    &lt;a href="#" onclick="javascript:getTree('EXPAND,#A1#');"&gt;
      &lt;img src="#IMAGE_PREFIX#Fndtre03.gif" width="16" height="22" border="0"&gt;
    &lt;/a&gt;
    &lt;/td&gt;Expanded Parent:
    &lt;td&gt;
    &lt;a href="#" onclick="javascript:getTree('CONTRACT,#A1#');"&gt;
      &lt;img src="#IMAGE_PREFIX#Fndtre05.gif" width="16" height="22" border="0"&gt;
    &lt;/a&gt;
    &lt;/td&gt;Expanded Parent Last:
    &lt;td&gt;
    &lt;a href="#" onclick="javascript:getTree('CONTRACT,#A1#');"&gt;
      &lt;img src="#IMAGE_PREFIX#Fndtre06.gif" width="16" height="22" border="0"&gt;
    &lt;/a&gt;
    &lt;/td&gt;Parent Node Template:
    &lt;tr&gt;
    #INDENT#
    &lt;td colspan="#COLSPAN#" valign="CENTER" class="tiny"&gt;
      #NAME# #DRILL_UP#
    &lt;/td&gt;
    &lt;/tr&gt;Node Text Template:
    &lt;tr&gt;
    #INDENT#
    &lt;td colspan="#COLSPAN#" valign="CENTER" class="tiny"&gt;
      #NAME#
    &lt;/td&gt;
    &lt;/tr&gt;Name Link Anchor Tag:
    &lt;a href="#A2#"&gt;#NAME#&lt;/a&gt;Name Link Not Anchor Tag:
    &lt;a href="#A2#"&gt;#NAME#&lt;/a&gt;8 - On your page 1 (where the tree will actually be displayed), set the page template to one that includes ".. with Sidebar" - this allows you to use region position 2 to show the tree on the left
    9 - Then create a new HTML region and put this in the Page Template Region Position 2 display point. The source of this region should be:
    &lt;div id="MyTree"&gt;&lt;/div&gt;10 - Then add another HTML region on your page. This should use No Template and be in the Before Footer display point. The source of this should be:
    &lt;script type="text/javascript"&gt;
    function getTree(req)
      var get = new htmldb_Get(null,$x('pFlowId').value, null, 2);
      get.add('TEMP_REQUEST', req);
      var gReturn = get.get(null,'&lt;htmldb:BOX_BODY&gt;','&lt;/htmldb:BOX_BODY&gt;');
      document.getElementById('MyTree').innerHTML = gReturn;
      document.getElementById('MyTree').innerHTML += "";
      get = null;
      gReturn = null;
    getTree('');
    &lt;/script&gt;11 - Then add a report on the page. The source of this should be:
    SELECT EMPNO, ENAME, JOB, SAL, COMM
    FROM EMP
    WHERE EMPNO = :P1_EMPNO12 - Add a new page item to the report region. This should be a "Display as Text (saves state)" item and called P1_EMPNO
    To explain how this works:
    Firstly, a Region Pull should only pull contents of a region that does not contain any page items. The region should be the only thing on the page and the page itself must not contain the normal page layout (that is, there should be no tabs etc) - hence the "Page Snippet" page template
    When you click on a normal tree's + or - icons for an item, it actually passes a request of either CONTRACT,xxx or EXPAND,xxx (where xxx is the ID for the node being expanded/collapsed).
    The getTree() function receives as a parameter a value that we can use for the request. Initially, this is an empty string, so the tree will display in its default state.
    Then, as you click on a + or - on our adjusted tree, a call is made to the getTree() function passing in the desired CONTRACT or EXPAND value.
    In the Ajax call (the htmldb_Get() function), we do not call an application process (the second null parameter) but tell it that we want the output from page 2 (the final parameter)
    The get.add(..) line passes our request value into the TEMP_REQUEST application item. This is done before the get.get(..) call - which does the actual pull.
    When page 2 is being rendered on the server, the "On Load - Before Header" takes the value from the TEMP_REQUEST item and sets it as the proper request value for the page. The tree then renders using this (in the same way as it would if the request value was passed via the URL)
    The get.get(..) line, retrieves everything on page 2 and updates the DIV tag contents in our page 1 region - which now shows the expanded or collapsed node(s).
    As we have updated the tree's definition to call javascript when the + or - are clicked, the actual links are defined in the additional A1 and A2 fields that are available on a tree's SQL. We position #A1# and #A2# on the tree's templates where we want the link to appear - hence having to update so many of the tree's template definitions.
    Hopefully, you should be able to adjust the above to fit your application - just remember that my page 1 is the page that is being displayed to the user and page 2 contains the tree. As long as you follow the same steps as above and adjust for your page numbers and SQL, you should be able to achieve your results
    Andy

  • Hierarchical Tree Data Query/Record Group Question

    I need help with Hierarchical Forms right now. I'm currently trying to implement a hierarchical tree to display the different items in different categories. I have been reading up on it for the past few days, and i do not understand a few things.
    What is the difference between a data query and record group? they seem the same to me.
    How does the XX = prior XXX work? i understand that this is what connects the parent to the child.
    How do you determine what depth the node is? its done in the record group/data query, but how do i decide what level it is dynamically?
    Thanks a lot in advance!

    Thanks! I am unable to create a table specifically for the tree because i am using tables that have been ported live and are in use. My question about levels is how do I know which depth the node is. For example, i have a category called Information Technology and a category item called Business Informatics. I want to know how to decide that the Category(information technology) is on level 1 and the Item(business informatics) is on level 2.
    Information Technology
    |_
    Business Informatics
    And i do know how the Connect By XX = prior XXX works in the data query/record group.
    Thanks for your help!

  • Ajax and JSTL Query possible?

    Hi all ! I want to know if this is possible and if you have an example you could show. So far Im trying like this:
    function ajaxFunction(){
         alert("ajaxFunction");
         var ajaxRequest;  // The variable that makes Ajax possible!
         try{
              // Opera 8.0+, Firefox, Safari
              ajaxRequest = new XMLHttpRequest();
         } catch (e){
              // Internet Explorer Browsers
              try{
                   ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
              } catch (e) {
                   try{
                        ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
                   } catch (e){
                        // Something went wrong
                        alert("Your browser broke!");
                        return false;
         // Create a function that will receive data sent from the server
         ajaxRequest.onreadystatechange = function(){
              if(ajaxRequest.readyState == 4){     
              appendOptionLast(ajaxRequest.responseText);
         //var age = document.getElementById('age').value;
         //var wpm = document.getElementById('wpm').value;
         //var sex = document.getElementById('sex').value;
         //var queryString = "?age=" + age + "&wpm=" + wpm + "&sex=" + sex;
         //alert("Antes open");
         ajaxRequest.open("GET", "/TWC/Comun/Ajax.jsp", true);
         //alert("Despues open");
         ajaxRequest.send(null);
    }And here is my JSP thats doing the query.
    <%@page contentType="text/html"%>
    <%@ page import="beans.*,java.util.*" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix=”sql” %>
    <%@page pageEncoding="ISO-8859-1"%>
    <sql:setDataSource dataSource=”jdbc/TWC” />
    <sql:query var=”qryItems” >
        SELECT User_ID
        FROM product
        ORDER BY nombre
    </sql:query>
    <c:forEach var=”row” items=”${qryItems.rows}”>
         User: <c:out value=”${row.User_ID}” /><br> 
    </c:forEach>Thanks!

    thanks guys but I finally got it to work with JSTL and ajax.
    The only "weird" thing is that when I parse the data to my JSP I get a bunch of white spaces at the end of each value for each field. Here is my code:
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
    <sql:setDataSource dataSource="jdbc/TWCApp" />
    <sql:query var="producto">
    select ITEMDESC AS name,IV00101.ITEMNMBR AS Number,USCATVLS_2 AS category,USCATVLS_1 AS Brand,
    USCATVLS_3 AS Type,CURRCOST AS Invoice_price,
    QTYONHND AS Stock_number, IV00102.LOCNCODE AS Location
    from TWC.dbo.IV00101 JOIN TWC.dbo.IV00102 ON IV00101.ITEMNMBR=IV00102.ITEMNMBR
    WHERE IV00101.ITEMNMBR = '${param.product}' AND IV00102.LOCNCODE = '${param.location}'
    </sql:query>
    <c:forEach items="${producto.rows}" var="row">
    ${row.name},${row.number},${row.category},${row.brand},${row.type},${row.Invoice_price},${row.Stock_number},${row.Location}
    </c:forEach>Here is my JS:
    ajaxRequest.onreadystatechange = function(){
              if(ajaxRequest.readyState == 4){     
              appendOptionLast(ajaxRequest.responseText);
    function appendOptionLast(valor)
      //alert(valor);
      //var elOptNew = document.createElement('option');
      var elSel = document.getElementById('category_producto');
      var mySplitResult = valor.split(",");
      document.form1.nombre_producto.value=mySplitResult[0];
      document.form1.numero_producto.value=mySplitResult[1];
      document.form1.category_producto.value=mySplitResult[2];
      document.form1.brand_producto.value=mySplitResult[3];
      document.form1.type_producto.value=mySplitResult[4];
      document.form1.invoice_producto.value=mySplitResult[5];
      document.form1.stocknumber_producto.value=mySplitResult[6];
      if(mySplitResult[6]>0){
      document.form1.stock_producto.value="Available"
      else{document.form1.stock_producto.value="Out of stock"
      document.form1.location_producto.value=mySplitResult[7];So how I can get rid of all those extra spaces at the end of each value?
    thanks!
    Edited by: juanmanuelsanchez on Apr 2, 2010 11:29 PM
    Edited by: juanmanuelsanchez on Apr 2, 2010 11:32 PM

  • Complex Tree Structure Query

    Hi,
    I have a table which contains the hierarchial data upto 4 levels. I needed to have the information of all the four levels in a row, so I created 3 tree structured views and one another view using the tree structured views as below
    --To get the great grand parent id for the children*
    CREATE OR REPLACE VIEW VR_PO_TREE AS
    SELECT LEVEL pathlength,
    connect_by_root partner_organization_id root_po,
    partner_organization_id,
    partner_common_name,
    partner_organization_type
    FROM partner_organization po
    START WITH po.org_entity_above_id IS NULL
    CONNECT BY PRIOR po.partner_organization_id = po.org_entity_above_id
    ORDER BY po.partner_organization_id;
    -- level 2 (grant parent) id
    CREATE OR REPLACE VIEW VR_PO_AREA_TR AS
    SELECT LEVEL pathlength,
    connect_by_root partner_organization_id root_po,
    partner_organization_id,
    partner_common_name,
    partner_organization_type
    FROM partner_organization vcpo
    START WITH vco.partner_organization_type = 'AREA'
    CONNECT BY PRIOR vcpo.partner_organization_id = vcpo.org_entity_above_id
    ORDER BY vcpo.partner_organization_id;
    --level 3 (parent) id*
    CREATE OR REPLACE VIEW VR_PO_REGION_TREE AS
    SELECT LEVEL pathlength,
    connect_by_root partner_organization_id root_po,
    vcpo.partner_organization_id,
    vcpo.partner_common_name,
    vcpo.partner_type
    FROM partner_organization vcpo
    START WITH vcpo.partner_organization_type = 'REGION'
    CONNECT BY PRIOR vcpo.partner_organization_id = vcpo.org_entity_above_id
    ORDER BY vcpo.partner_organization_id;
    ---and finally created a view to have all the levels in a single row
    CREATE OR REPLACE VIEW VR_PO_ALL_TREE AS
    SELECT pot.pathlength,
    po.partner_organization_id,
    po.partner_common_name,
    pot.root_po int_partner_org_id,
    pot.intl_po_name int_partner_common_name,
    vpat.root_po area_partner_org_id,
    vpat.area_po_name area_partner_common_name,
    vprt.root_po region_partner_org_id,
    vprt.region_po_name region_partner_common_name
    FROM partner_organization po
    JOIN vr_po_tree pot
    ON pot.partner_organization_id = po.partner_organization_id
    LEFT outer JOIN vr_po_area_tr vpat
    ON vpat.partner_organization_id = po.partner_organization_id
    LEFT OUTER JOIN vr_po_region_tree vprt
    ON vprt.partner_organization_id = po.partner_organization_id;
    All the views are working fine, very fast, giving the expected output.
    if we make a join to the view vr_po_all_tree in a query that also works fine. However, if we make an outer join to a query that has the join to vr_po_all_tree, Oracle throws an internal error - Ora-00600 internal error codes, arguments [qrctce1], [0],[0],.....
    Is the view vr_po_all_tree is cause for this problem?, in such a case can any one help me to rewrite the view with a simple query to give the same results?
    Thanks in advance.
    Nattu
    Edited by: Nattu on Nov 26, 2009 8:25 PM
    Edited by: Nattu on Nov 27, 2009 11:48 AM
    Edited by: Nattu on Nov 27, 2009 11:55 AM

    Hi,
    if we make a join to the view vr_po_all_tree in a query that also works fine. However, if we make an outer join to a query that has the join to vr_po_all_tree, Oracle throws an internal error - Ora-00600 internal error codes, arguments [qrctce1], [0],[0],.....
    Is the view vr_po_all_tree is cause for this problem?As Sven said, ORA-00600 is the sign of some low-level problem, and you should seek a solution from Oracle support. Your views are not the cause of this problem; most likely, the views trigger something that would not be a problem except for a installatin problem or maybe a bug.
    We can try to find a work-around for you, but don't ignore the problem.
    in such a case can any one help me to rewrite the view with a simple query to give the same results?It seems very likely that you could do something that didn't involve so many CONNECT BYs and outer joins.
    Post some sample data (CREATE TABLE and INSERT statements) and the results you want from that data.
    Simplify as much as possible. For example, in the first view you say:
    CREATE OR REPLACE VIEW VR_PO_TREE AS
    SELECT LEVEL pathlength,
    connect_by_root partner_organization_id root_po,
    connect_by_root partner_common_name intl_po_name,
    connect_by_root is_wbti is_wbti,
    connect_by_root is_sil_int is_sil_int,
    connect_by_root organization_entity_code int_org_entity_code,
    org_entity_above_id, partner_organization_id,
    partner_organization_type,
    sys_connect_by_path(partner_organization_id, '\') po_path_id,
    sys_connect_by_path(partner_common_name, '\') po_path_name
    FROM ...That is, you're selecting 1 pseudo-column (LEVEL), 4 CONNECT_BY_ROOTs, 3 plain columns, and 2 SYS_CONNECT_BY_PATHs.
    Can you post a problem with just one of each: 1 pseudo-column, 1 CONNECT_BY_ROOT, 1 plain column, and 1 SYS_CONNECT_BY_PATH?  Adding the others later should be easy.
    Any information you can give about the data would be helpful.
    In particular,
    (a) Can org_entity_above be NULL on the same row where partner_organization_type is 'AREA' or 'REGION'?
    (b) How many ancestors with partner_organization_type = 'AREA' Can a node have? 1? No more than 1?  1 or more? 0 or more?
    (c) Same for 'REGION'.  How many ancestors with partner_organization_type = 'REGION' Can a node have? 1? No more than 1?  1 or more? 0 or more?
    (d) Can a node with partner_organization_type = 'REGION' be the ancestor of a row with partner_organization_type = 'AREA'?
    (e) Other way around: can a node with partner_organization_type = 'AREA' be the ancestor of a row with partner_organization_type = 'REGION'?
    Some of these questions may seem silly to you, because you know the table and the data so well.  I don't, so you'll have to explain things.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Create a New Tree in Query Access Manager

    Folks,
    Hello. In PeopleTools Query Access Manager, click on button "Create a New Tree" to create a new Query Access Tree, the system always comes up this message:
    "You are not authorized to update definition QUERY_TREE_OLAP. You are not authorized to update the specific definition. Contact your security administrator for access to the specified definition."
    Do any folks understand how to solve this problem ?
    Thanks.

    I figured it was that simple.
    I haven't seen you on here in awhile.

  • Oracle Tree Hierarchy Query

    Hi,
    Hoping someone can assist with this query:
    I am currently using this query to construct a tree hierarchy, i.e.
    SELECT "EMP"."MGR" as "MGR",
            "EMP"."EMPNO" as "EMPNO",
            "EMP"."ENAME" as "ENAME" ,
            (select count(*)  from "EMP" "EMP2" where  "EMP2"."MGR" = "EMP"."EMPNO") BranchCount
    from
    "EMP" "EMP"
    where
    "EMP"."MGR"  =  :BRANCH_IDUsing this query, I also need to retrieve the LEVEL pseudo-column as well for each record retrieved as I need the LEVEL info for trying to determine at what level of the tree I am at.
    I would actually like to incorporate the LEVEL column into the above query - is this possible?
    Thanks.
    Tony.

    SQL> desc test
    Name Null? Type
    COLUMN1 VARCHAR2(10)
    COLUMN2 VARCHAR2(10)
    MGR VARCHAR2(10)
    SQL> select * from test
    2 /
    COLUMN1 COLUMN2 MGR
    1 a 33
    3 i 33
    2 g 33
    4 b 33
    5 c 44
    6 d 44
    22 e
    33 f 22
    44 h 22
    9 rows selected.
    SQL> select column1, column2, mgr, level
    2 from test
    3 start with mgr = '22'
    4 connect by prior column1 = mgr
    5 order by level
    6 /
    COLUMN1 COLUMN2 MGR LEVEL
    33 f 22 1
    44 h 22 1
    6 d 44 2
    4 b 33 2
    5 c 44 2
    3 i 33 2
    1 a 33 2
    2 g 33 2
    8 rows selected.

  • ADF tree example

    I'm trying to create a tree in my web application that shows
    (country -> locations -> departments -> employees ).
    I tried using the following link
    http://www.oracle.com/technology/products/jdev/101/tutorials/e2etopfaces/e2etopfaces.htm#t3
    This example shows only 2 levels (Location, department).
    Are there any examples for multi-level tree web applications?
    Thank you.

    There is a patch for JDeveloper available on MOS that fixes the issue of not being able to drag & drop a tree on a page.
    Patch 14022488: ADF TREE TABLE CONTROL BLANK WHEN ATTEMPTING TO DROP ON JSPX OR JSF PAGE

  • Struts 2 Ajax working example

    Hi all,
    I want a working example of struts 2 Ajax.
    What I want is user name validation when registering new user.
    please help me with the relevant link if any.
    Thanks in advance,
    Hirav

    I normally do not recommend RoseIndia tutorials. However, [this one|http://www.roseindia.net/struts/struts2/struts2ajax/ajax-login-form.shtml] seems exactly like what you are looking for. As an aside, that was the top hit for me in Google. Learn how to search, attempt to solve your problem, and then post when you are actually stuck on something.
    - Saish

  • Tree: execute query for ech node

    Hi,
    I use JDeveloper 10.1.3.1.0 and ADF.
    I use a af:tree object and when entire hierarchy exists of about 200 nodes, then this works fine.
    Now I have a hierarchy of 2000 nodes, first level 5 nodes, second level 4 nodes per nodes, third level 10 nodes per node
    and the fourth level about 10 nodes per node.
    When I enter the screen, I expand only the first level, but for each node (2000) the query has been executed.
    Is there a possibility to query only the first level nodes?
    Regards,
    LvL

    Hi,
    I use JDeveloper 10.1.3.1.0 and ADF.
    I use a af:tree object and when entire hierarchy exists of about 200 nodes, then this works fine.
    Now I have a hierarchy of 2000 nodes, first level 5 nodes, second level 4 nodes per nodes, third level 10 nodes per node
    and the fourth level about 10 nodes per node.
    When I enter the screen, I expand only the first level, but for each node (2000) the query has been executed.
    Is there a possibility to query only the first level nodes?
    Regards,
    LvL

Maybe you are looking for