Subject | Re: [Firebird-Architect] datatype "enum"? |
---|---|
Author | Martijn Tonies |
Post date | 2005-11-09T10:59:26Z |
> are there any plans to integrate a new datatype for enumerationsI hope not :-)
> ("enum") to Firebird?
> MySQL has such a datatype (look at"enum" actually isn't a datatype at all. It's more of a string
> http://dev.mysql.com/doc/refman/4.1/en/enum.html)and I think it would
> be a great addition for Firebird.
datatype with a set of possible values.
Now, "enum" itself is badly implemented. For example, having an
enum of ('1', '2', '3') sets it to '' if you perform:
update mytable set e = '4'
To get more-or-less the same with Firebird, try this:
create table mytable
(
enum_col varchar(10) check (enum_col in ('1', '2', '3'))
)
With regards,
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com