Boolean datatype on Firebird - experiences? lazarus / 16-Databases ---------------------------------------------------------------------- BigChimp · 2014-06-04 14:22 I wonder whether anybody has tried this http://wiki.lazarus.freepascal.org/firebird#Boolean_data_types with Lazarus code using either sqldb or Zeos? ---------------------------------------------------------------------- mangakissa · 2014-06-05 06:48 Yes I did. But it doesn't work. SQLdb still see it as an integer. But I don't use FPC 2.71. ---------------------------------------------------------------------- BigChimp · 2014-06-05 06:56 Thanks. Yes, that's probably true. ---------------------------------------------------------------------- mse · 2014-06-05 07:09 In MSEgui version of SQLdb a persistent tfield with ftBoolean can be used for a ftSmalint column. In tibconnection: Code: [Select]procedure TIBConnection.SetParameters(cursor: TSQLCursor; AParams: TmseParams); ...      case paramtypes[sqlvarnr] of ...       ftInteger,ftsmallint : begin         if datatype = ftboolean then begin          i:= 0;          if asboolean then begin           i:= 1;          end;         end         else begin          i:= AsInteger;         end;         Move(i, po1^.SQLData^,po1^.SQLLen); ... ---------------------------------------------------------------------- BigChimp · 2014-06-05 07:19 So the DOMAIN definition in the wiki fits is compatible with mse ---------------------------------------------------------------------- mangakissa · 2014-06-05 09:15 The problem doesn't rely on SQLdb. In the case of Firebird en MySQL (even Oracle) the original datatype is givven back from the library client. I already made a topic of this problem. The main issue here is TDBGrid checkboxes are not working if datatype isn't a real boolean. ---------------------------------------------------------------------- mse · 2014-06-05 09:45 Is it not possible to use a persistent TBooleanField instead of a TSmallIntField with FCL-SQLdb? MSEgui-SQLdb allows it, not tested with original SQLdb. ---------------------------------------------------------------------- korba812 · 2014-06-05 11:56 Some time ago I added this functionality to the MDO library. But I stopped to use it in their projects because there is a lot of inconsistency and it is not natural for Firebird.