Is there an ENUM datatype in Firebird?
There is no such type, but you can emulate almost any type with domains. For example, if you have enum allowing values 1, 3 and 7, you can define a domain like this:
CREATE DOMAIN my_enum
AS smallint CHECK (value IS NULL or VALUE IN (1,3,7));
Later you can define columns like this:
CREATE TABLE t1
(
id INTEGER,
x1 MY_ENUM,
x2 MY_ENUM NOT NULL,
...
);
For string enums, the procedure is similar:
CREATE DOMAIN db_enum
AS varchar(20) CHECK (value IS NULL or VALUE IN ('Firebird','MySQL','MSSQL'));
If you need different enums for different columns, you can define multiple domains, or simply put a check constraint on the table.