Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: newbie:
Steve Holland wrote:
> I'm basicallly trying unsuccessfully to store a simple tree structure
> in an Oracle 8i (8.1.7) database i.e.
>
> SectionA
> -SectionA_sub1
> -SectionA_sub2
> SectionB
> -SectionB_sub1
> --SectionB_sub1_sub1
> --SectionB_sub1_sub2
> -SectionB_sub2
> SectionC
> -SectionC_sub1
> -SectionC_sub2
>
> Could some one please give me some hints/help pointers in the right
> direction of how I would go about doing this, if possible it would be
> able to cope with adding more sections/subsections to an undefined
> number of layers. To me this looks like an XML document, would it be
> easier trying to work with this as an XML document (if so any ideas??
> I'm using PHP), or try and put this in a table.
>
> any help would be great.
>
> Thanks In Advance
>
> Steve
You can do this in three fields:
ID
DESCRIPTION
PARENT_ID
With PARENT_ID pointing to the ID of the parent record.
Use CONNECT BY to query the database.
Daniel A. Morgan Received on Wed Jun 20 2001 - 12:00:53 CDT
![]() |
![]() |