Home » Developer & Programmer » Forms » Urgent Help plzzzzzzzzz - Hierarchical Tree
Urgent Help plzzzzzzzzz - Hierarchical Tree [message #87485] Fri, 07 January 2005 05:05 Go to next message
oralover
Messages: 97
Registered: January 2005
Member
hi all!

may be you laugh on me but i want to know anyway.

i am using 6i and 10g and wants to know about Hierarchical Tree to populate records like :
1) from emp table which DO NOT HAVE mgr field
2) display data as:
-DEPTNO
-- emp1
-- emp2
-- emp3
-DEPTNO
-- emp1
-- emp2
-DEPTNO
-- emp1
-- emp2

i used - or -- only to make Levels its not required.
please write an SQL statement to populate Hierarchical Tree for above.

thanks in advance for help.
Re: Urgent Help plzzzzzzzzz - Hierarchical Tree [message #87508 is a reply to message #87485] Sun, 09 January 2005 23:43 Go to previous messageGo to next message
oralover
Messages: 97
Registered: January 2005
Member
nobody knows how to do that????
Re: Urgent Help plzzzzzzzzz - Hierarchical Tree [message #114672 is a reply to message #87485] Mon, 04 April 2005 16:56 Go to previous messageGo to next message
oratim
Messages: 1
Registered: April 2005
Junior Member
Try this:

> break on department;
> Select department, employee from emp_table;


This should give you the output you are looking for. If you want a truly hierarchical query where there is parent and child relationship within table look at connect by clause, connecting the parent to the child.

Good luck. Hope this helps.
Re: Urgent Help plzzzzzzzzz - Hierarchical Tree [message #114738 is a reply to message #114672] Tue, 05 April 2005 07:42 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
Nah, in forms? BREAK? I don't think so.

oralover, try this query in the 'DATA QUERY' property of your tree item:
SELECT -1 state
     , DECODE (deptno, NULL, 2, 1) dlevel
     , DECODE (deptno, NULL, 'Employee ' || ename, 'Department ' || dname) label
     , NULL icon
     , DECODE (deptno, NULL, deptno, deptno) DATA
  FROM (SELECT   DECODE (LAG (d.deptno) OVER (ORDER BY d.deptno), d.deptno, NULL, d.deptno) deptno
               , d.dname
               , e.ename
               , e.empno
            FROM emp e, dept d
           WHERE d.deptno = e.deptno
        ORDER BY d.deptno)


In the small test I ran, it gave the following output:

./fa/56/0/

MHE
  • Attachment: formtree.jpg
    (Size: 10.55KB, Downloaded 1769 times)
Re: Urgent Help plzzzzzzzzz - Hierarchical Tree [message #272814 is a reply to message #87485] Sun, 07 October 2007 15:27 Go to previous messageGo to next message
ZZTOP2005
Messages: 31
Registered: August 2007
Member
Hi Senior Member
Thank's For Your Explain And Code
That's Right And Good
I Have A Question:
How Can I have a Tree With3 Level Like Below:
-DEPTNO
--emp1
---SAL1
-DEPTNO
--emp2
---SAL2
-DEPTNO
--emp3
---SAL3
.
.
.
.
.

[Updated on: Sun, 07 October 2007 22:45]

Report message to a moderator

Re: Urgent Help plzzzzzzzzz - Hierarchical Tree [message #272894 is a reply to message #272814] Mon, 08 October 2007 02:24 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
I have no idea what you are trying to show - USE CODE TAGS!!!

Other hierarchy entries in this forum are:
A form with table definition.
http://www.orafaq.com/forum/t/77009/0/unread/67467/#msg_229389
Another form.
http://www.orafaq.com/forum/m/215628/67467/?srch=tree#msg_215628
And another
http://www.orafaq.com/forum/t/83541/67467/
And
http://www.orafaq.com/forum/t/83923/67467/
Populate Nth level of Hierarchical tree
http://www.orafaq.com/forum/t/87093/67467/

David
Re: Urgent Help plzzzzzzzzz - Hierarchical Tree [message #273055 is a reply to message #272894] Mon, 08 October 2007 23:22 Go to previous messageGo to next message
ZZTOP2005
Messages: 31
Registered: August 2007
Member
Hi David
Thank You for your guid.
i see those explain.that's good but i want use Maaher method for my problem.
now my question is Maaher method dosen't change to create a tree with 3 level Or it possible?
Re: Urgent Help plzzzzzzzzz - Hierarchical Tree [message #273675 is a reply to message #273055] Thu, 11 October 2007 05:16 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
received via Email

Thank's For Your Explain And Code
That's Right And Good
I Have A Question:
How Can I have a Tree With3 Level Like Below:
-DEPTNO
   |--emp1
       |--SAL1
-DEPTNO
   |--emp2
       |--SAL2
-DEPTNO
   |--emp3
       |--SAL3

By Your Code?
Any takers?

MHE
Re: Urgent Help plzzzzzzzzz - Hierarchical Tree [message #273704 is a reply to message #273675] Thu, 11 October 2007 07:46 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
Rereading this thread, I came to the conclusion that my initial query was wrong. I'm afraid the query won't return all data as required. Perhaps a union (all) with DEPT can solve this...

Then there's the modification: 2 lines for each employee instead of one. A row generator could take care of that.

MHE
Re: Urgent Help plzzzzzzzzz - Hierarchical Tree [message #273729 is a reply to message #87485] Thu, 11 October 2007 09:08 Go to previous message
MarcL
Messages: 455
Registered: November 2006
Location: Connecticut, USA
Senior Member
Or a hierarchal query .. not sure why the OP is resisting that
Previous Topic: Change User In RunTime
Next Topic: check box
Goto Forum:
  


Current Time: Thu Dec 08 08:50:36 CST 2016

Total time taken to generate the page: 0.11628 seconds