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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Newbie: Hierarchical Table Structure?

Re: Newbie: Hierarchical Table Structure?

From: <markp7832_at_my-dejanews.com>
Date: Tue, 25 May 1999 13:32:00 GMT
Message-ID: <7ie8og$qou$1@nnrp1.deja.com>


In article
<Pine.LNX.4.10.9905251123150.14216-100000_at_tfischer.ab.deakin.edu.au>, Thomas Fischer <tfischer_at_deakin.edu.au> wrote:

> Hi,
>
> I just started to learn about Oracle and I want
> to implement a database of which I already exactly
> know what it once should do. My problem:
> Everything I read about Oracle so far deals with
> normal tables whereas I need an (extendable) tree
> structure instead of a constant column/line
> matrix.
>
> To I have to 'simulate' a tree in a normal
> table or is there a way to arrange 'tables'
> in a hierarchical way?
>
> Thanks,
> Thomas
>
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> Thomas Fischer, Deakin University Geelong/Australia
> Snailmail: 4/450 Ryrie Street, 3219 East Geelong AU
> himself_at_tfischer.de tfischer_at_deakin.edu.au
> See me live at: http://www.tfischer.de/cam.html
>
>

Yes, there is a way to 'arrange' tables in a hierarchical manner. Bill of Material structures do this. Look in the SQL manual at the connect by and start with clauses. The 7.3 manual had sample SQL using the emp table. In general a column will be defined in the table that refers back to the primary key, PK, of the parent row. You can use the summit2.sql example code in $ORACLE_HOME/rdbms/demo that comes with ver 8 to work with the connect and start with clauses.

I hope this helps get you started.
--
Mark D. Powell -- The only advice that counts is the advice that  you follow so follow your own advice --

--== Sent via Deja.com http://www.deja.com/ ==-- ---Share what you know. Learn what you don't.--- Received on Tue May 25 1999 - 08:32:00 CDT

Original text of this message

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