Firebird Simulated Boolean Fields

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
SeaCay
Posts: 26
Joined: Wed 10 Jan 2007 03:03

Firebird Simulated Boolean Fields

Post by SeaCay » Tue 03 Jul 2007 04:20

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

Alex
Posts: 655
Joined: Mon 08 Nov 2004 08:39

Post by Alex » Tue 03 Jul 2007 06:59

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.

SeaCay
Posts: 26
Joined: Wed 10 Jan 2007 03:03

Post by SeaCay » Tue 03 Jul 2007 08:18

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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 04 Sep 2007 13:39

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.

lucenty
Posts: 2
Joined: Wed 30 Apr 2008 07:38

Post by lucenty » Wed 30 Apr 2008 07:45

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.

Post Reply