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 -> Re: Organize data for a TreeView

Re: Organize data for a TreeView

From: Walter Dorninger <wdor_at_magnet.at>
Date: Sun, 19 Sep 1999 13:15:15 +0200
Message-ID: <7s2g0b$ep7$1@orudios.magnet.at>


Sorry no time for an example but - have you ever tried to query your tree using the "connect by" SQL clause Oracle provides for retrieving treeviews ?

-Walter-

Magnus S. Petersen <magnus_at_post.olivant.fo> wrote in message news:37e4b4b4_at_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 - 06:15:15 CDT

Original text of this message

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