Subject RE: [IBO] Problem with parameters in query
Author
Jason,

I just found a quick workaround, that eliminates the error, but I am not sure, if there will be any negativ sideeffects. So please could you take a look at it?
In the function SQLTypesEqual in IB_ParseEx I commented out the lines where the sqlsubtypes are compared. The subtype of the first paramater is 21 and that one of the second is 1557. I did not find the place in the source code, where the subtypes are set. So I have no idea how it should be, but commenting out the lines that compare subtypes removed the error.

function SQLTypesEqual( aVAR1,
                        aVAR2: PXSQLVAR;
                        AllowCoercion: boolean = false ): boolean;
var
  AType1, AType2: integer;
begin
  AType1 := aVAR1.sqltype;
  AType2 := aVAR2.sqltype;
  AType1 := AType1 - AType1 mod 2;
  AType2 := AType2 - AType2 mod 2;
  Result := AType1 = AType2;
  if not Result then
  begin
    if AType1 = SQL_SHORT then AType1 := SQL_INT64;
    if AType2 = SQL_SHORT then AType2 := SQL_INT64;
    if AType1 = SQL_LONG then AType1 := SQL_INT64;
    if AType2 = SQL_LONG then AType2 := SQL_INT64;
    if AType1 = SQL_FLOAT then AType1 := SQL_DOUBLE;
    if AType2 = SQL_FLOAT then AType2 := SQL_DOUBLE;
    if AllowCoercion then
    begin
      if AType1 = SQL_TEXT then AType1 := SQL_VARYING;
      if AType2 = SQL_TEXT then AType2 := SQL_VARYING;
      if AType1 = SQL_TYPE_DATE then AType1 := SQL_TIMESTAMP;
      if AType2 = SQL_TYPE_DATE then AType2 := SQL_TIMESTAMP;
      if AType1 = SQL_TYPE_TIME then AType1 := SQL_TIMESTAMP;
      if AType2 = SQL_TYPE_TIME then AType2 := SQL_TIMESTAMP;
    end;
    Result := ( AType1 = AType2 );
  end;
  {
  if Result then
    if ( AType1 = SQL_TEXT ) or
       ( AType1 = SQL_VARYING ) then
    begin
      if ( aVAR1.sqlsubtype <> aVAR2.sqlsubtype ) then
      begin
        if AllowCoercion and
          (( aVAR1.sqlsubtype = 0 ) or
           ( aVAR2.sqlsubtype = 0 )) then
        begin
          if aVAR1.sqlsubtype = 0 then
            aVAR1.sqlsubtype := aVAR2.sqlsubtype;
          if aVAR2.sqlsubtype = 0 then
            aVAR2.sqlsubtype := aVAR1.sqlsubtype;
        end
        else
          Result := false;
      end;
    end;
    }
end;

Best Regards
Helmut