Subject Re: datatype "enum"?
Author GeorgLedermann
<m.tonies@u...> wrote:

> "enum" actually isn't a datatype at all. It's more of a string
> datatype with a set of possible values.

But that is exactly what I mean.

Think about a field like "gender". It may have the values "male",
"female" or "unknown". For not storing chars in the database, some
kind of integer (0,1,2) should be used for storing. There is a
mapping: 0=unknown, 1=male, 2=female

But a statement like "SELECT gender FROM contact" should give string
results. In addition a statement like "UPDATE contact SET
gender='male') should be possible. But internally only integer should
be stored. The predefined and possible values should be part of the
schema.


> Now, "enum" itself is badly implemented.

Maybe. But in Firebird it can be implemented in a better way ;-)


Kind regards,
Georg