home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!munnari.oz.au!bruce.cs.monash.edu.au!monu6!escargot!otto!dtb
- From: dtb@otto (David Bath)
- Newsgroups: comp.databases
- Subject: Re: Hierarchical Structures in RDBMS
- Date: 8 Jan 93 04:36:24 GMT
- Organization: RMIT Computer Centre
- Lines: 54
- Message-ID: <dtb.726467784@otto>
- References: <1993Jan6.094340.5870@devon.co.uk> <18335@autodesk.COM>
- NNTP-Posting-Host: otto.bf.rmit.oz.au
-
- tchild@autodesk.com (Timothy Child) writes:
-
- >In article 5870@devon.co.uk, don@duncan (Don Radvan) writes:
- >>
- >> I have an interesting problem. I need to represent hierarchical data
- >> structures within a relational db, but I need to do it in a way that
- >> permits the user to create his own hierarchy. That is, I do not know the
- >> structure of the hierarchy before hand.
- >>
- >> For example:
- >> A user wants to organize various objects. These objects will
- >> appear as leaf nodes in the user's own hierarchy. The user may choose many
- >> different ways of organizing these objects, indeed, s/he may have many
- >> simultaneous hierarchies of organization for each set of objects. What
- >> results is a sort of directory tree. Each directory is a category of
- >> objects and each "file" or non-directory entry in a directory is an
- >> object. Given the objects of apples and oranges, we may get the following:
- >>
- >> Stuff
- >> |
- >> --------------------------------
- >> Food Non-Food
- >> |
- >> ---------------------- . . .
- >> Fruit Veggies
- >> |
- >> -------------
- >> Apples Oranges
- >>
- >> And so when s/he does a query such as the following:
- >> select name where Food = "Fruit"
- >> or
- >> select name where Stuff = "Food" AND Food = "Fruit"
- >>
- >> we would get Apples and Oranges.
- >>
-
- > It's possible to model this problem with an RDBMS, but I don't know of
- > a STANDARD way to express the appropriate SQL to return the information
- > and I don't think there is one!
-
- ORACLE has a lovely CONNECT BY PRIOR clause that joins leaves to nodes.
-
- Very sexy if you like trees. I do not think other RDBMS have this
- facility short of doing it by hand (and blowing your cursor limit).
-
-
- David T. Bath Email:dtb@otto.bf.rmit.oz.au Phone:03-3477511
- Global Technology Corporation, 179 Grattan St, CARLTON, VIC, 3153, AUSTRALIA
- "Failure to emulate is the best revenge" - Marcus Aurelius
- --
- David T. Bath Email:dtb@otto.bf.rmit.oz.au Phone:03-3477511
- Global Technology Corporation, 179 Grattan St, CARLTON, VIC, 3153, AUSTRALIA
- "Failure to emulate is the best revenge" - Marcus Aurelius
-