Home » Developer & Programmer » Forms » Hierarchy tree structure (merged)
Hierarchy tree structure (merged) [message #627198] Sat, 08 November 2014 14:19 Go to next message
sanodani
Messages: 98
Registered: October 2014
Member
Hallo all,
I am trying to write hierarchy tree structure Programm in orcale forms.
I have created Record Group and my code is as follow:

--RECORD GROUP
select 1, level, to_char(br), null, to_char(br)
from bru
where bru.br like :control.br || '%'
connect by prior to_char(br) = to_char(br1) and length(br)-1 = length(br1)
or prior to_char(br) = to_char(br2) and length(br)-1 = length(br2)
or prior to_char(br) = to_char(br3) and length(br)-1 = length(br3)
or prior to_char(br) = to_char(br4) and length(br)-1 = length(br4)
start with br1 is null
order siblings by br

and then after i have two more Triggers when-button-pressed and when-tree-node-selected.

the Programm Shows the tree structure but when i select one node in the tree then it does not display the correct siblings.
I Need help to improve this code, to display the correct siblings when i select the respective node on the tree.
Can anyone help me in this regards please? Smile
I would be very thankful for your help

Thanking you
Hierarchy Tree Structure [message #627210 is a reply to message #627198] Sun, 09 November 2014 04:56 Go to previous messageGo to next message
sanodani
Messages: 98
Registered: October 2014
Member
Hallo
Can anyone help me, how to create hierarchy tree structure in Oracle forms?
thnakx
Re: Hierarchy Tree Structure [message #627215 is a reply to message #627210] Sun, 09 November 2014 06:25 Go to previous message
mughals_king
Messages: 391
Registered: January 2012
Location: pakistan
Senior Member
HTREE Structure is not a problem download this example fmb and take idea from this otherwise let me know i will solve your issue according to your requirement.i don't have the exactly web-link for this but i have save some Examples follow this Hope this will help you alot.


ORDER SIBLINGS BY

The rows in a hierarchical query are returned as a tree, the children following the parent. ORDER SIBLINGS BYpreserves the hierarchy and orders the children of each parent.

SELECT
   CONCAT
   (
      LPAD
      (
         ' ',
         LEVEL*3-3
      ),
      ENAME
   ) ENAME
FROM
   EMP
CONNECT BY
   PRIOR EMPNO = MGR
START WITH
   MGR IS NULL
ORDER SIBLINGS BY
   EMP.ENAME;
ENAME
----------------
KING
   BLAKE
      ALLEN
      JAMES
      MARTIN
      TURNER
      WARD
   CLARK
      MILLER
   JONES
      FORD
         SMITH
      SCOTT
         ADAMS

Clark comes after Blake and before Jones; they are under King and ordered by their name. Their children are sorted and the hierarchical appearance is preserved.
ORDER BY without SIBLINGS destroys the hierarchy:

SELECT
   CONCAT
   (
      LPAD
      (
         ' ',
         LEVEL*3-3
      ),
      ENAME
   ) ENAME
FROM
   EMP
CONNECT BY
   PRIOR EMPNO = MGR
START WITH
   MGR IS NULL
ORDER BY
   EMP.ENAME;
ENAME
--------------
         ADAMS
      ALLEN
   BLAKE
   CLARK
      FORD
      JAMES
   JONES
KING
      MARTIN
      MILLER
      SCOTT
         SMITH
      TURNER
      WARD



Regards
Mughal

[Updated on: Sun, 09 November 2014 06:39]

Report message to a moderator

Previous Topic: inactive sessions
Next Topic: How to export Data to excel
Goto Forum:
  


Current Time: Mon Dec 18 13:45:48 CST 2017

Total time taken to generate the page: 0.02034 seconds