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: variable column table

Re: variable column table

From: Jan Gelbrich <j_gelbrich_at_westfalen-blatt.de>
Date: Wed, 28 May 2003 08:56:20 +0200
Message-ID: <bb1mlr$4c1ds$1@ID-152732.news.dfncis.de>


"Billy Verreynne" <vslabs_at_onwe.co.za> schrieb im Newsbeitrag news:bavlg0$rjt$1_at_ctb-nnrp2.saix.net...
> sybrandb_at_yahoo.com wrote:
>
> > Design a meta-system where you have one central table holding entities
> > and attributes. Currently don't have such a design at hand, but I have
> > seen it several times.
>
> You mean having one table with loads of columns?
>
> Then have a kind of dictionary table that says for entity type 1, col 1 is
> name, col 2 is colour and so on, while for entity type 2, col 1 is weight
> and col 2 is a description?
>
> Or do I have my mouth around the wrong end of the bottle?
>
> --
> Billy

Hi, Billy,
of cause, You *can* do something like this:

CREATE TABLE anything
(

    id number(10), --well, at least they HAVE an id ...     field_name varchar2(100), -- !!!
    value varchar2(50),
    description varchar2(255), --put anything you want in it )
/

which to the most extreme means that You would only have to have *this very and only one* table as Your entire data model ! A naive designer might think "oh thatth GREAT ... maketh my wurk eesee ..."

But, IMHO, this is perfect **CRAP** . It has no normal form at all. Then You will end up with **multiple** references to the field_names, much hard-coded SQL & PL/SQL,
very error_prone, and fk constraints becoming "virtual", as it bcomes fuzzy.

I actually *do* have a table like this in one of my dbs, and I definitely hate this type of "flexibility". To my view, it is just a laziness in design, that is regarded even "smart" today >8( ...
It makes me mad 10 times a day when I have to select from it ... It does not make thing easy, it makes it all unmaintainable !

So my suggest is: if You have the chance to reconsider Your design, do it, befre it is too late
and everything starts basing on it !

Just an opinion.
Jan Gelbrich Received on Wed May 28 2003 - 01:56:20 CDT

Original text of this message

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