Marius0188
asked on
Delphi 7 :: Executing MS SQL 2005 Stored Procedure with Output Variabel
Dear Experts,
I can't find a working example of how to execute a MS SQL 2005 stored procedure which returns an output variable within Delphi 7 code.
Please show me an example.
Thanks.
I can't find a working example of how to execute a MS SQL 2005 stored procedure which returns an output variable within Delphi 7 code.
Please show me an example.
Thanks.
use a TADOQuery and do it like this
ADOQuery1.SQL.Text := 'set nocount on' + #13#10 +
'declare @res int ' + #13#10 +
'exec @spGetTritonPartTypes :po, @output OUTPUT ' + #13#10
'set nocount off ' + #13#10 +
'select @res as res';
with adoquery1.parameters.param byname('po ') do
begin
paramtype := ftInteger;
value := 5000;
end;
AdoQuery1.Open;
ShowMessage(ADOQuery1.Fiel dByName('r es').AsInt eger);
something like that anyway, I'm not near my dev p.c.
ADOQuery1.SQL.Text := 'set nocount on' + #13#10 +
'declare @res int ' + #13#10 +
'exec @spGetTritonPartTypes :po, @output OUTPUT ' + #13#10
'set nocount off ' + #13#10 +
'select @res as res';
with adoquery1.parameters.param
begin
paramtype := ftInteger;
value := 5000;
end;
AdoQuery1.Open;
ShowMessage(ADOQuery1.Fiel
something like that anyway, I'm not near my dev p.c.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the reply.
Just 1 fix and it is working 100%.
"@spGetTritonPartTypes"
shoud be: "spGetTritonPartTypes"
Thanks again.
Just 1 fix and it is working 100%.
"@spGetTritonPartTypes"
shoud be: "spGetTritonPartTypes"
Thanks again.
ASKER
Open in new window
sp-error.jpg