一个奇怪的问题,在线等。请高手帮忙看看(20分)

  • 主题发起人 主题发起人 hui717
  • 开始时间 开始时间
H

hui717

Unregistered / Unconfirmed
GUEST, unregistred user!
存储过程这样写到<br>CREATE PROCEDURE GetMaxNumBL<br>@Tempnum &nbsp;nvarchar, &nbsp; --参数:当天的日期字符串格式<br>@Temp1 &nbsp;nvarchar, &nbsp;--参数:当前的订料单编号<br>@i &nbsp;integer output &nbsp;--参数:返回订料单当前编号是否是系统中最大的编号<br> AS<br>declare @Tempmax nvarchar<br><br>select @Tempmax=max(Bldlbh) from Bldld where Bldlbh like '%'+@Tempnum+'%'<br><br>if @Temp1 = @Tempmax<br> &nbsp;begin<br> &nbsp; &nbsp;Set @i = 1<br> &nbsp;end<br>Else<br> &nbsp;begin<br> &nbsp; &nbsp;Set @i= 0<br> &nbsp;end<br><br>return @i<br>GO<br><br>在delphi中调用语句如下:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;with ADOGet do<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;j:=0;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Close;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ProcedureName:= 'GetMaxNumBL';<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Parameters.Refresh;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Parameters.ParamByName('@Tempnum').Value:= wutemp1;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Parameters.ParamByName('@Temp1').Value:= wutemp2;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Parameters.ParamByName('@i').Value:= j;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Open;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;j:=FieldByName('i').value;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end;<br><br>编译时能顺利通过<br>运行时却提示错误,好像是没有找到返回值之类的<br><br>请问是怎么回事儿呀
 
急用呀<br><br>请帮帮忙
 
存储过程中 <br>return @i<br>改成 select @i as i<br><br>试试
 
多谢道长<br><br>按你说的方法,问题是解决了<br><br>可就是弄不明白<br><br>为什么 return 返回却不行呀
 
不用奇怪了!查帮助![:D]
 
只有select会返回数据集
 
多人接受答案了。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
719
import
I
I
回复
0
查看
763
import
I
后退
顶部