delphi怎么调用存储过程返回参数?
本人编写了一段代码,用adostoredproc调用存储过程,显示时没反应.请各位高手帮我指点一下,成分感谢!try
with datamoduleado.ADOStoredProc1 do
begin
close;
procedurename:='ISDNoutput_BookInfo';
parameters.Clear ;
parameters.CreateParameter('@TypeName',ftstring,pdinput,10,0);
parameters.ParamByName('@TypeName').Value:=ISDNEdit.Text ;
parameters.CreateParameter('@ISDNoutput',ftstring,pdoutput,10,0);
execproc;
ISDNEdit.Text :=parameters.ParamValues['@ISDNoutput'] ;
end;
except
begin
messagedlg('数据库操作失败',mterror,[mbok],0);
exit;
end;
close;
end;
下面是我的存储过程:
create proc ISDNoutput_BookInfo
@TypeName varchar(60),
@ISDNoutput varchar(10) output
as
declare @ISDNleft varchar(2),@ISDNright varchar(7)
select @ISDNleft=BookTypeID from BookType where TypeName=@TypeName
set @ISDNright=(convert(varchar,(select (max(convert(int,right(ISDN,7)))+1)
from BookInfo
where left(ISDN,2)=@ISDNleft)))
while(len(@ISDNright)<7)
set @ISDNright='0'+@ISDNright
set @ISDNoutput=isnull(@ISDNleft+'-'+@ISDNright,'')
return @ISDNoutput
请你们看完后帮我指点一下.到底错在哪里?