通过delphi 提供的存储过程控件来调用容易出这种问题,另存储过程中的游标返回的数据集是否有条数的限制(50分)

  • 主题发起人 wwding68
  • 开始时间
W

wwding68

Unregistered / Unconfirmed
GUEST, unregistred user!
一、以下是我在SqlServer里建立的存储进程,有没有哪儿有错?
CREATE PROCEDURE tj
@spbh char(7),
@gsrq char(8),
@kcsl float,
@xszsl float,
@dhzsl float
AS
if @spbh<>null
begin
select spbh,sum(sl) as xszsl from t_xsqd where (spbh=@spbh) group by spbh
exec @xszsl=xszsl
select spbh,sum(sl) as dhzsl from t_dhqd where (spbh=@spbh) group by spbh
exec @dhzsl=dhzsl
insert into t_gsb (gsrq,spbh,sl) values(@gsrq,@spbh,@kcsl)
end
一、以下是在 Delphi里用StoredProc1调用的,代码为:
with StoredProc1 do
begin
close;
ParamByName('@spbh').asstring:='11100012';
ParamByName('@gsrq').asstring:='2001-12';
ExecProc
end;

一、StoredProc1属性设置如下:

StoredProcName 为dbo.tj;1
参数为:
0-Result
1-@spbh input
2-@gsrq input
3-@kcsl output
4-@xszsl output
5-@dhzsl output

结果运后出现:
General SQL error.
could not find stored procedure 'dbo.tj;1

请各位高手帮帮忙。谢谢!


还有,我在存储过程中用游标,如果游标返回的数据集的条目比较多时,存储过程会
自动的中断

请各位高手帮帮忙。谢谢!
 
>>StoredProcName 为dbo.tj;1
手工改为tj并加上参数。
建议使用ado。
 
你是用的bde吧。把';1'去掉就可以了
 
呵呵,如楼上所说,我也遇到过。
 
顶部