改为:
CREATE procedure mypro
@countname int output
as
begin
select count(name) from customer
end;用storedproc
with storedproc1 do
begin
close;
m:=parambyname('@countname').asinteger;(先定义m)
active:=true;
end;
CREATE procedure mypro
@countname int output
as
begin
select count(name) from customer
end;用storedproc
with storedproc1 do
begin
close;
m:=parambyname('@countname').asinteger;(先定义m)
active:=true;
end;
好象写的不对吧? 变量@countname只定义了,而没有付值
a : integer;
strSQL := 'exec mypro' + inttostr(a) + output';
可用fieldbyname取出结果
用adoquery就可以。
CREATE procedure mypro
@countname int output
as
begin
select @countname=count(name) from customer
end;用storedproc
with storedproc1 do
begin
close;
m:=parambyname('@countname').asinteger;(先定义m)
active:=true;
end;