Execute procedure do nothing why

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Daniel Fagnan
Posts: 55
Joined: Fri 13 Oct 2006 00:08

Execute procedure do nothing why

Post by Daniel Fagnan » Sun 25 May 2008 13:01

CREATE PROCEDURE dbo.AvrgGurleyValue
@tapelo VARCHAR(20)
AS
BEGIN
Begin Transaction
Update LAB_GURLEY
set LAB_GURLEY.AvrgValue = (SELECT AVG(LAB_GURLEY.GurleyValue)
FROM LAB_GURLEY
Where LAB_GURLEY.TapeLot = @tapelo
GROUP BY LAB_GURLEY.TapeLot)
where LAB_GURLEY.TapeLot = @tapelo;
Commit;
END

:( If I execute this procedure directly in my MsSql Manager all is Ok
but in my Delphi code do nothing Why

procedure TDm.QryGurleyAfterPost(DataSet: TDataSet);
begin
If dataset.FieldByName('tapeLot').asString '' then
begin
Try
With proc1
begin
Close;
prepare;
StoredProcName := 'AvrgGurleyValue';
Params[0].asString := dataset.FieldByName('tapeLot').asString;
execProc;
unprepare
end // with proc1
finally
Dataset.Refresh;
end; //Try
end;//If dataset.FieldByName('tapeLot').asString '' then
end;

Daniel Fagnan
Posts: 55
Joined: Fri 13 Oct 2006 00:08

Found the problem

Post by Daniel Fagnan » Sun 25 May 2008 21:07

Bad params[0] sj=hould be params[1]

Post Reply