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"
///// 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"