help me every body! 200coin(200分)

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

hurryman

Unregistered / Unconfirmed
GUEST, unregistred user!
////////////////////////////////////
///// sql server: ///////////
/////////////////////////////////////
CREATE PROCEDURE caldata
(@srmbcount CHAR(9) OUTPUT ,
@lrmbcount CHAR(9) OUTPUT ,
@psrmbcount CHAR(9) OUTPUT,
@shkdcount CHAR(9) OUTPUT ,
@lhkdcount CHAR(9) OUTPUT,
@pshkdcount CHAR(9) OUTPUT)
AS
SELECT @srmbcount=CAST(( SELECT SUM(rmb) FROM pcps WHERE type=1 AND hkd=0) AS VARCHAR(9)) RETURN 0
SELECT @lrmbcount=CAST(( SELECT SUM(rmb) FROM pcps WHERE type =2 AND hkd=0) AS VARCHAR(9)) RETURN 0
SELECT @psrmbcount=CAST(( SELECT SUM(rmb) FROM pcps WHERE type =2 AND hkd=0) AS VARCHAR(9)) RETURN 0
SELECT @shkdcount=CAST((SELECT SUM(hkd) FROM pcps WHERE type=1 AND rmb=0) AS VARCHAR(9)) RETURN 0
SELECT @lhkdcount=CAST((SELECT SUM(hkd) FROM pcps WHERE type=2 AND rmb=0) AS VARCHAR(9)) RETURN 0
SELECT @pshkdcount=CAST((SELECT SUM(hkd) FROM pcps WHERE type=3 AND rmb=0) AS VARCHAR(9)) RETURN 0
GO
/////////////////////////////////////////
////////// delphi : /////////
/////////////////////////////////////
procedure TForm2.count;
var s1,s2,s3,s4,s5,s6:string;
begin
with dataunit.DataModule1.spcount do
begin
ExecProc ;
s1:=Parameters.ParamByName('@srmbcount').value ; <-----------error point
s2:=parameters.parambyname('@lrmbcount').Value ;
s3:=parameters.parambyname('@psrmbcount').Value ;
s4:=parameters.parambyname('@shkdcount').Value ;
s5:=parameters.parambyname('@lhkdcount').Value ;
s6:=parameters.parambyname('@pshkdcount').Value ;
end;
statusbar1.Panels[0].Text :='祏戳 R:'+s1+' H:'+s4;
statusbar1.Panels[1].text :='?戳 R:'+s2+' H:'+s5;
statusbar1.Panels[2].Text :='禬戳 R:'+s3+' H:'+s6;
end;
/////////////////////

error message : " invalid variant type conversion"
 
把spcont的Parameters的属性帖出来.
将s1-s7的类型改为Variant试试
 
CREATE PROCEDURE caldata
(@srmbcount CHAR(9) OUTPUT ,
@lrmbcount CHAR(9) OUTPUT ,
@psrmbcount CHAR(9) OUTPUT,
@shkdcount CHAR(9) OUTPUT ,
@lhkdcount CHAR(9) OUTPUT,
@pshkdcount CHAR(9) OUTPUT)
AS
我想得到這6個變量的輸出值,可為啥我只能得到第一個,后面的5個的我得不到
是不是我的這個句子有問題?
 
第一条查询语句后你已经执行return了,怎么可能得到后面的几个值呢?
 
这个错误太低级了。。
 
后退
顶部