Storedprocedure Parameter not found
Posted: Sun 13 Nov 2016 08:51
I call a storedprocedure SQL_SP_CheckVoorraadBesteld that has 3 input parameters (@sArtikelcode VarChar(30), @sDebNr VarChar(10), @sOrdernummer VarChar(10),)
The code I use:
When I only use 1 parameter, it works ok. But when using 2 ore more parameters I get the exception:
Exception Class: EDatabaseError; SQL_SP_CheckVoorraadBesteld: Parameter '@sDebNr' not found;
The Storedprocedure does work fine on the SQL server, i have tested this.
I have tried:
But with the same result.
I Use Delphi XE-2 with hothix 1, and DBExpress version 6.5.7.
What's wrong?
Kind regards
Robert Meijer
The code I use:
Code: Select all
Try
SQL_SP_CheckVoorraadBesteld.ParamByName('@sArtikelcode').Value := 'Artcode';
SQL_SP_CheckVoorraadBesteld.ParamByName('@sDebNr').Value := 'A123';
SQL_SP_CheckVoorraadBesteld.ParamByName('@sOrdernummer').Value := 'O123';
SQL_SP_CheckVoorraadBesteld.Prepared:=True;
Except
On E:Exception Do begin
LogError(E);
Application.MessageBox(PChar('Opvragen Bestelvoorraad informatie mislukt!' +#13#10+ #13#10 + 'Foutcode:! '+ E.Message +#13#10+ #13#10 + 'Opvragen bestelvoorraad mislukt'), 'Fout', MB_ICONERROR);
Exit;
end;
end; // End Try/Except
Exception Class: EDatabaseError; SQL_SP_CheckVoorraadBesteld: Parameter '@sDebNr' not found;
The Storedprocedure does work fine on the SQL server, i have tested this.
I have tried:
Code: Select all
SQL_SP_CheckVoorraadBesteld.param.ParamByName('@sDebNr').Value := 'A123';
I Use Delphi XE-2 with hothix 1, and DBExpress version 6.5.7.
What's wrong?
Kind regards
Robert Meijer