Giter Club home page Giter Club logo

Comments (6)

BerndSchoelzel avatar BerndSchoelzel commented on June 5, 2024

With this change it works for me.

function TFIBXSQLVAR.GetAsBoolean: boolean;
begin
  Result := False;
  if not IsNull then
    case FXSQLVAR^.sqltype and (not 1) of
      SQL_BOOLEAN,SQL_SHORT:
        Result := PShort(FXSQLVAR^.sqldata)^=ISC_TRUE;
     FB3_SQL_BOOLEAN: // BS 25.03.2019 
        Result := PByte(FXSQLVAR^.sqldata)^=ISC_TRUE;
      SQL_LONG:
       Result  := PLong(FXSQLVAR^.sqldata)^=ISC_TRUE;
      SQL_INT64:
       Result  := PInt64(FXSQLVAR^.sqldata)^=ISC_TRUE;
    else
        FIBError(feInvalidDataConversion, [nil])
    end;
end;

from fibplus.

mvb75 avatar mvb75 commented on June 5, 2024

Аналогичное поведение, ФИБ последний отсюда, Delphi XE2, FireBird 4. При выполнении запроса через TpFIBQuery.ExecWP(const ParamValues: array of Variant) с BOOLEAN в параметрах вылазит ошибка:

Project ... raised exception class EFIBInterBaseError with message 'Incompatible column/host variable data type.
SQL error state =22018
Dynamic SQL Error.
SQL error code = -303.
Conversion error from string "0".

Как поправить?

from fibplus.

mvb75 avatar mvb75 commented on June 5, 2024

В общем, разобрался, маленькая поправка снимает проблему.
Модуль: FIBQuery.pas
Метод: procedure TFIBXSQLVAR.SetAsVariant(Value: Variant);
кусок

    varBoolean:
      if Value then
        AsVariant := VariantTrue
      else
        AsVariant := VariantFalse;

заменить на:

    varBoolean:
      case sSQLType of
        FB3_SQL_BOOLEAN: AsBoolean := Value;
        else if Value then
               AsVariant := VariantTrue else
               AsVariant := VariantFalse;
      end;

from fibplus.

mvb75 avatar mvb75 commented on June 5, 2024

Еще одна поправочка в том же модуле:
function TFIBXSQLVAR.GetAsBoolean: boolean; begin Result := False; if not IsNull then case FXSQLVAR^.sqltype and (not 1) of SQL_BOOLEAN,SQL_SHORT: Result := PShort(FXSQLVAR^.sqldata)^=ISC_TRUE; SQL_LONG: Result := PLong(FXSQLVAR^.sqldata)^=ISC_TRUE; SQL_INT64: Result := PInt64(FXSQLVAR^.sqldata)^=ISC_TRUE; FB3_SQL_BOOLEAN: Result := PBoolean(FXSQLVAR^.sqldata)^ = True; else FIBError(feInvalidDataConversion, [nil]) end; end;

from fibplus.

mvb75 avatar mvb75 commented on June 5, 2024

В редакторе норм показывает, тут чет все в кучу слепил. В общем, думаю, там понятно будет.

from fibplus.

mvb75 avatar mvb75 commented on June 5, 2024

Тут, похоже, тоже забросили бедные фибы...

from fibplus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.