Subject | Re: Equivalent to ENUM? |
---|---|
Author | vogonjeltzprostetnic |
Post date | 2006-02-27T18:28:19Z |
Are you trying to emulate a boolean data type in Firebird? If so, a
domain will be your ticket (until such time as Firebird implements
booleans, that is):
CREATE DOMAIN D_BOOLEAN AS SMALLINT
CHECK (VALUE IS NULL OR VALUE IN (-1, 0));
This places the desired restriction on any columns defined using the
domain. Make sure, of course, that you don't actually name the domain
BOOLEAN, since this is a Firebird reserved word.
-Marc Benedict
domain will be your ticket (until such time as Firebird implements
booleans, that is):
CREATE DOMAIN D_BOOLEAN AS SMALLINT
CHECK (VALUE IS NULL OR VALUE IN (-1, 0));
This places the desired restriction on any columns defined using the
domain. Make sure, of course, that you don't actually name the domain
BOOLEAN, since this is a Firebird reserved word.
-Marc Benedict