Newbie SQL Question

From: jamie <jamie_at_angel.com>
Date: 1997/05/09
Message-ID: <01bc5c4c$45197f20$d4d285c6_at_doofus.angel.com>#1/1


Oh wise internet folk,

I have a problem which I've no idea how to solve. Its been years since I looked at SQL and I dont know if its appropriate.

My system has objects. An object has a number of properties, each with a textual name, a type, and a value. The types are, integer, real and 'object', where 'object' is a reference to another object.

Object 1:
"Color", integer, 5
"Size", real, 2.34
"On-top-of", object, 2

Object 2:
"Color", integer, 4
"Size", real, 1.23
"Strangeness", real, 1.0
"Underneath", object, 1

Each object can have zero or more fields, configurable at run time. This is why I wanted to store the fields in a database. It is a requirement that within an object, the textual name is unique.

I guess I dont know how to handle multiple data types. My first attempt was to have a seperate table for each of the data types, with a foreign key into the master object table, but then objects of different types can have the same textual name.

I'm sure I'm either missing something dead obvious, or someone's figured out a way to do this.

Much appreciated.

Jamie Received on Fri May 09 1997 - 00:00:00 CEST

Original text of this message