Re: Flexible columns



herbasher <robmnl@xxxxxxxxx> wrote:

I am developing a database system that will allow users to store any
object whatsoever in a database.

Usually a database has predefined tables and fields.

What I need, is a table that basically has any field.

So I want to be able to say,

INSERT INTO objects (type, name) VALUES ('person', 'John')
INSERT INTO objects (type, name, num_employees) VALUES ('company',
'Apple', '10.000')
INSERT INTO objects (type, name, color) VALUES ('fruit', 'banana',
'yellow')

And that without defining the table columns. I just want to be able
to *use* those columns, they can default to varchar.

That's the kind of flexibility I need. Any ideas in this direction?
Anything is appreciated. Someone must have tried this before.

Oh, yes. It has been done before. It is called
Entity-Attribute-Value, and it is a very BAD thing.

Why not just use a shoebox?

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.
.



Relevant Pages

  • Re: Flexible columns
    ... storing any object whatsoever efficiently. ... Holy cow, Batman! ... Why are you storing the data in a database, ...
    (comp.databases)
  • Re: Flexible columns
    ... Well I know I am going against holy cows here, ... storing any object whatsoever efficiently. ... Why are you storing the data in a database, ...
    (comp.databases)
  • Flexible columns
    ... I am developing a database system that will allow users to store any ... object whatsoever in a database. ...
    (comp.databases)
  • Re: 3vl 2vl and NULL
    ... >>Gene Wirchenko wrote: ... >>> A screen is not a database. ... I have an opinion, with plenty of rationale. ... > of dogmatism, I tend to wait for the train wreck. ...
    (comp.databases.theory)
  • Re: End-to-end 2VL and non-1NF
    ... >>>is a very common problem. ... >That might work for a normalized database side of the equation. ... >Before doing any required fields validation you cannot even assume ... Gene Wirchenko ...
    (comp.databases)