Subject | Re: [IBO] Parameter problems using DataSnap and IBO |
---|---|
Author | Jason Wharton |
Post date | 2004-11-14T06:39:17Z |
I believe I have this resolved in the beta of ibo 4.5.
Please let me know if you would like to test this out.
Jason Wharton
Please let me know if you would like to test this out.
Jason Wharton
----- Original Message -----
From: "kokok_kokok" <kokok_kokok@...>
To: <IBObjects@yahoogroups.com>
Subject: [IBO] Parameter problems using DataSnap and IBO
> I use DataSnap with IBO. When I modify the id of a row, IBO does not
> generate the appropriate parameters for the SQL sentence.
>
> PRIMARY KEY of the table = EMPRESA, TIPUS, CODI
>
> IBO generates the following sentence when I modify the CODI field:
>
>
> UPDATE CODIFICATION SET EMPRESA = :EMPRESA , TIPUS = :TIPUS ,
> CODI = :CODI , DESCRIPCIO = :DESCRIPCIO
> WHERE CODIFICATION.EMPRESA = :OLD.EMPRESA AND CODIFICATION .TIPUS
> = :OLD.TIPUS AND CODIFICATION.CODI = :OLD.COD
>
> This sentence is fine. The problem is in parameters. If I modify
> CODI, for example setting CODI=1, if before CODI was 0, I can see in
> the SQL monitor:
>
> [PARAMETERS]
> CODI=0
> OLD.CODI=0
>
> It is an error, because CODI should be 1, not 0.
>
>
> I have been tracing the IBODataset.pas source and I have found the
> reason but not the solution.
>
>
> 1) PSUpdateRecord deletes the "OLD." prefix of the "OLD.CODI"
> parameter name
>
>
> 2) Then , line 6593, function TIBODataSet.AssignParamsValues
>
>
> if Assigned( Self.DataSource ) and Assigned(
> Self.DataSource.Dataset ) then
> if Assigned( Self.DataSource.Dataset.FindField(
> tmpCol.FullFieldName )) then
> Continue;
> AssignParamValueToCol( AParams[ii], tmpCol );
> tmpParam := FindParam( tmpCol.FullFieldName );
> if Assigned( tmpParam ) then
> tmpParam.Value := AParams[ii].Value;
> end;
> end;
> end;
> finally
>
>
>
> The line "tmpParam := FindParam( tmpCol.FullFieldName );" cannot
> find the corresponding parameter. It fails and it assigns the new
> value to OLD.CODI because tmpCol.FullFieldName = "CODI",
> not "OLD.CODI" (remember the previous PSUpdateRecord function)
>
> Well, it is my diagnostic but I do not know the solution. Any help
> well be welcome. Thanks