Forum Stats

  • 3,874,218 Users
  • 2,266,685 Discussions
  • 7,911,771 Comments

Discussions

Tree Region Example

Eve
Eve Member Posts: 55
edited Apr 21, 2013 5:55PM in APEX Discussions
Hi,

I'm using my apex.oracle.com workspace. I'm trying to create a tree region using the emp table. I'm using the typical wizard but when i run the page the tree is not displayed.

This is the query built by apex with the wizard.

select case when connect_by_isleaf = 1 then 0
when level = 1 then 1
else -1
end as status,
level,
"ENAME" as title,
null as icon,
"EMPNO" as value,
null as tooltip,
null as link
from "#OWNER#"."EMP"
start with "MGR" is null
connect by prior "EMPNO" = "MGR"
order siblings by "ENAME"

http://apex.oracle.com/pls/apex/f?p=41771:3:8143710593092:::::
Tagged:

Best Answer

  • Tom Petrus
    Tom Petrus Member Posts: 1,151 Gold Trophy
    Answer ✓
    Run page : runs fine - no errors.

    Execute SQL in workshop:
    No data found.
    Okay. So obviously data related.
    select * from emp
    16 rows returned
    Great.

    Connect by start with clause:
    start with "MGR" is null
    Oops. No records where "MGR" is null. No tree!

Answers

This discussion has been closed.