Zeos stored procedure "parameter mismatch" errors
Posted: 06.09.2009, 18:37
I have written some pascal code to restrict results retrieved from a Firebird 2.1 table based on a start date and an end date. I am having problems passing string parameters to a Firebird stored procedure that fetches these results using ZeosLib components. The stored procedure with string parameters works perfectly when executed from inside the Firebird database but it raises a "parameter mismatch" exception from inside my code.
I've tried using date parameters in the stored procedure & in my code but the result is the same. I believe the problem is my code or the zeos stored procedure component.
Any tips to help me get round this problem will be greatly appreciated.
Code: Select all
with zsprRapports do
begin
Close;
//ParamByName('DEBUT_PERIODE').AsString := '''01.01.2009''';
//ParamByName('FIN_PERIODE').AsString := '''31.12.2009''';
StoredProcName := 'UTILISATION_FONDS_SOLIDARITE';
ParamByName('DEBUT_PERIODE').AsString := '''01.01.2009''';
ParamByName('FIN_PERIODE').AsString := '''31.12.2009''';
Open;
First;
// Compute the number of rows to be added to the StringGrid BEFORE filling the grid
SGrid1.RowCount := RecordCount + SGrid1.FixedRows;
// Fill the string grid with the results of the stored procedure
while not EOF do
begin
for intGridCol := 0 to FieldCount - 1 do
begin
SGrid1.Cells[intGridCol + SGrid1.FixedCols, intGridRow + SGrid1.FixedRows] :=
Fields[intGridCol].AsString;
end;
Next;
Inc(intGridRow);
end;
Close;
end;
Any tips to help me get round this problem will be greatly appreciated.