Page 1 of 1
BUG REPORT:Passing NULL params
Posted: 24.10.2005, 14:52
by jennecy
TZStoredproc or TZQuery does not execute when there are params with NULL values fith Firebird, raising "parameter mismatch" error.
Posted: 24.10.2005, 15:30
by jennecy
Hi All,
Think I Found where the bug is...
But I dont know how to send the correction.. ( can anyone help/teach me me ?)
so, I'm sendind the simple change I did on ZStoredProcedure.pas:
procedure TZStoredProc.SetStatementParams(Statement: IZPreparedStatement;
ParamNames: TStringDynArray; Params: TParams; DataLink: TDataLink);
var
I: Integer;
Param: TParam;
Stream: TStream;
begin
for I := 0 to Params.Count - 1 do
begin
Param := Params;
if Params.ParamType in [ptResult, ptOutput] then
Continue;
if Param.IsNull then
// THIS LINE DOES NOT WORK:
// Statement.SetNull(I, ConvertDatasetToDbcType(Param.DataType));
// CORRECT LINE:
Statement.SetNull(I+1, ConvertDatasetToDbcType(Param.DataType));
else begin
case Param.DataType of
ftBoolean:
..........
Thanks !
Jennecy