Page 1 of 1

Firebird Simulated Boolean Fields

Posted: Tue 03 Jul 2007 04:20
by SeaCay
Hello Support

I have a domain defined in a Firebird DB to simulate BOOLEAN fields. The definition is

Code: Select all

CREATE DOMAIN D_BOOLEAN AS
SMALLINT
DEFAULT 0
CHECK ((VALUE IN (0, 1)))
I would like to access fields that use this domain throught IBDAC and BDS2006 Delphi as

Code: Select all

somestate := .fieldByName('ABooleanField').asBoolean;
Currently I use

Code: Select all

someState := .fieldByName('ABooleanField').asInteger = 1);
I have read the IBDAC help files, PDFs and forum but can't find any documents relating to the treatment of simulated boolean fields.

Please can you advise how to reference a simulated boolean field as a boolean or point me to the relevant documentation?

regards and thanks

SeaCay

Posted: Tue 03 Jul 2007 06:59
by Alex
IBDAC doesn't support boolean domains. This limitation is caused by the conflict with the BOOLEAN datatype supported since InterBase 7 servers.
We will consider such feature support in one of the next IBDAC builds.

Posted: Tue 03 Jul 2007 08:18
by SeaCay
Yes please, I would like to see a feature added to support boolean fields in Firebird, although as per my original message, I do have a work-around.

regards

SeaCay

Posted: Tue 04 Sep 2007 13:39
by Plash
In the next IBDAC build we'll add the BooleanDomainFields option to TCustomIBCDataSet. This option will let you to enable using TBooleanField objects for fields with boolean domain.

Posted: Wed 30 Apr 2008 07:45
by lucenty
While I'm using TIBCTable with option BooleanDomainFields it doesn't works correct. I have defined domain BOOLEAN_FIELD as

Code: Select all

CREATE DOMAIN BOOLEAN_FIELD AS 
SMALLINT
NOT NULL 
CHECK (VALUE IN (0, 1)) 
Now I can use fields as boolean. But there is another problem.
The default value for BOOLEAN_FIELD named PRZEGLADANIE is set to 1 (means True). When I set option DefaultValues to true, the message appears:
Project pewid.exe raised exception class EDatabaseError with message ''1' is not a valid boolean value for field 'PRZEGLADANIE''.
What can I do? Regards.