Subject | RE: [IBO] Problem with parameters in query |
---|---|
Author | |
Post date | 2017-08-31T07:17:43Z |
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;varAType1, AType2: integer;beginAType1 := aVAR1.sqltype;AType2 := aVAR2.sqltype;AType1 := AType1 - AType1 mod 2;AType2 := AType2 - AType2 mod 2;Result := AType1 = AType2;if not Result thenbeginif 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 thenbeginif 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 thenif ( AType1 = SQL_TEXT ) or( AType1 = SQL_VARYING ) thenbeginif ( aVAR1.sqlsubtype <> aVAR2.sqlsubtype ) thenbeginif AllowCoercion and(( aVAR1.sqlsubtype = 0 ) or( aVAR2.sqlsubtype = 0 )) thenbeginif aVAR1.sqlsubtype = 0 thenaVAR1.sqlsubtype := aVAR2.sqlsubtype;if aVAR2.sqlsubtype = 0 thenaVAR2.sqlsubtype := aVAR1.sqlsubtype;endelseResult := false;end;end;}end;Best RegardsHelmut