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;
Execute procedure do nothing why
-
- Posts: 58
- Joined: Fri 13 Oct 2006 00:08
Found the problem
Bad params[0] sj=hould be params[1]