db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andre Berten <andre.ber...@gmx.de>
Subject Re: FireBird
Date Thu, 19 Jan 2006 21:01:24 GMT
Yes, I am listening and I will take a deeper look at weekend.

Hm, you want to map existing database columns to the jdbc types BOOLEAN
an BIT?

That may be a problem because there is more then one alternative to
define a boolean, e. q. bool smallint check (bool between 0 and 1)   or
  bool char default 'F' not null check (bool in ('T', 'F'))

A check constraint in firebird is internally realized with two triggers,
one for "before insert" and the other for "before update" which are
stored in the system table RDB$TRIGGERS. The column RDB$TRIGGER_SOURCE
holds the sql source of the triggers. For the constraint above this is
"check (bool between 0 and 1) or "check (bool in ('T', 'F'))". You have
to analyse the string.

The recommended way (Firebird Reference Book) is to define a domain:

create domain boolean as smallint check (value between 0 and 1);

create table test
(
  mbl boolean
);

Now you can eval the type name, but some user may prefer the char F/T
mapping. The check constraint of a domain is stored in column
RDB$VALIDATION_SOURCE of table RDB$FIELDS with the same format as
mentioned above.

Greetings,

André

Martin van den Bemt wrote:
> Hi everyone,
> 
> I got a long way with integrating firebird, though still some tests are
> failing.
> Since I am really swamped with work atm (untill probably the end of next
> week), I can only have a look after again to the firebird integration.
> If I can find an available timeslot before the end of the month, I will
> do the best I can..
> 
> If André Berten is still listening : can you have a look ? Pleas note
> that the integration depends on sql dialect 3!.
> If you by any chance know some fancy / simple query to retrieve the
> check parameters from the RDB$ system tables. I like to try to do some
> more specific type mapping based on the check constraint (eg check
> (avalue between 0 and 1) will map to the Boolean and BIT type, for which
> firebird lacks support..
> 
> Mvgr,
> Martin
> 

Mime
View raw message