Maneesh A N

Maneesh A N

  • NA
  • 179
  • 108.5k

sql2000 in vb6

May 31 2014 3:40 AM
CREATE procedure sp_VazhSaleshdr(
@intSave int,
@intVazhSaleCode int,
@intVazhSlipNo int,
@dteSaleDate datetime,
@strVazhipadName varchar(50),
@intNashatraCode int,
@dteVazhDate datetime,
@dblToatlAmount float ,
@strCancelFlag char(1),
@strCancelDescrip varchar(100),
@dteCancelDate datetime,
@intDocNo int,
@intSlipNo varchar(60),
@intCompanyid int,
@intUserid int,
@intNewVazhSaleCode int output,
@intNewReceiptNo int output
)
please check this query...i got error near cmd.execuse in code(above mentioned) error found: formula error,runtime error 55...pls answer me


As
Begin
if @intSave=0
Begin
--declare @intNewReceiptNo integer
select @intNewReceiptNo =Isnull(Max(VazhSlipNo),0)+1 from VazhipadItemSaleHdr
select @intNewVazhSaleCode=Isnull(Max(VazhSaleCode),0)+1 from VazhipadItemSaleHdr


insert into VazhipadItemSaleHdr
(
VazhSaleCode,
VazhSlipNo,
SaleDate,
VazhipadName,
NashatraCode,
VazhDate,
ToatlAmount,
CancelFlag,
CancelDescrp,
CancelDate,
DocNo,
SlipNo,
Companyid,UserId
)

values
(
@intNewVazhSaleCode,
@intNewReceiptNo ,
@dteSaleDate ,
@strVazhipadName ,
@intNashatraCode ,
@dteVazhDate ,
@dblToatlAmount,
@strCancelFlag ,
@strCancelDescrip ,
@dteCancelDate ,
@intDocNo ,
@intSlipNo,
@intCompanyid,@intUserid
)
End
Else if @intSave=1

Begin
update VazhipadItemSaleHdr
set
CancelFlag=@strCancelFlag,
CancelDescrp= @strCancelDescrip,
CancelDate=@dteCancelDate
where
VazhSaleCode=@intVazhSaleCode
End
Else if @intSave=2
Begin
delete from VazhipadItemSaleHdr
where
VazhSaleCode =@intVazhSaleCode

End
End