Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

@Parameter1 is not a parameter for procedure

ALTER PROCEDURE [dbo].[NST_InsertTblGenLedDet]
        @GHDHeader int,
      @Gldtype text,
      @GldAccount text,
      @GldDate DateTime, 
      @GldVoucherType int,
      @GldDebit   float=null,
      @GldCredit float= null,
      @GldDtaLine int= null
AS
DECLARE @ERR INT
BEGIN TRANSACTION
Insert into [TblGenLedDet] 
(GHDHeader,Gldtype,GldAccount,GldDate, GldVoucherType, GldDebit,GldCredit,GldDtaLine)
 values (@GHDHeader,@Gldtype,@GldAccount,@GldDate, @GldVoucherType, @GldDebit,@GldCredit,@GldDtaLine)



SET @ERR = @@Error
IF @ERR = 0   
BEGIN
      COMMIT TRANSACTION

END
ELSE
BEGIN
      ROLLBACK TRANSACTION
      RETURN @ERR               
END

enter image description here

I am getting this error again and again though i have specified the parameter name as @GldCredit it shows Parameter name as Parameter1

like image 704
vini Avatar asked Dec 21 '22 15:12

vini


1 Answers

In your code, you initialize gldCredit, but then update gldDebit. Your gldCredit parameter never has any of its members set, and thus, has its ParaameterName defautled to "@Paremeter1".

It looks like you copy/pasted the gldDebit code for setting up your parameter, but forgot to update all the references in the new block of code to point to gldCredit.

like image 77
Jon Senchyna Avatar answered Jan 02 '23 19:01

Jon Senchyna