Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hierarchy

Status
Not open for further replies.

thertel00

IS-IT--Management
Feb 12, 2007
34
0
0
US
There are a few different examples of this on here, but nothing quite like I need to do. I have a table in my DB with an ID, name and parent fields. I need to output this info in my ui but I am having trouble grouping them.

Query results:

ID Name Parent
100 Test NULL
101 Org1 NULL
102 Org2 101
103 Org3 102


I need to dynamically output this info so that the heirarchy is correct.

Example:

100 - Test
101 - Org1
--102 - Org2
----103 - Org3

Any ideas on making this happen with CFQUERY or CFLOOP?
 
Not sure if this is what you want, but try this:

select lpad('.',2*(level-1)) || to_char(child) s
from test_connect_by
start with parent is null
connect by prior child = parent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top