Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Organize data for a TreeView

Organize data for a TreeView

From: Magnus S. Petersen <magnus_at_post.olivant.fo>
Date: Sun, 19 Sep 1999 11:14:49 +0100
Message-ID: <37e4b4b4@news.olivant.fo>


Working with Delphi 5 Enterprise and Oracle 8,Personal Edition. I want to use a TreeView in a form to display data hierarchally to the user.

|--lawarea_1

| |--LawArea_1_a
| |--LawArea_1_b
| |--LawArea_1_b_1 | |--LawArea_1_b_2 | |--LawArea_1_b_3 | |--LawArea_1_b_3_a | |--LawArea_1_b_3_b | |--LawArea_1_b_3_c | |--LawArea_1_b_3_d | |--LawArea_1_b_3_d_1 | |--LawArea_1_b_3_d_2 |--LawArea_2
| |--LawArea_
| |--LawArea_
| |_LawArea_ | |_LawArea_ etcetera What would be the best way to organize the data in the database table. I have orgarnized the data in 3 columns as follows: Law_id LawArea Parent_id 1 LawArea_1 NULL 2 LawArea_2 NULL 3 LawArea_3 NULL 4 LawArea_1_a LawArea_1 5 LawArea_1_b LawArea_1 6 LawArea_1_b_1 LawArea_1_b
etc.
Parent_id is a foreign key referencing to the primary key Law_id of the same table.
I retreive a result set through a procedure residing in a package in the database and iterate through the result set with a While not EOF do loop.
This takes some time as the result set is very big. Compared to the very simple methods of the TreeView LoadFromFile and SaveToFile, my approach looks clumsy.
Is there an elegant way to do this ? and would some mercy soul give me an example
Regards
Magnus Received on Sun Sep 19 1999 - 05:14:49 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US