[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 252
  • Last Modified:

Procedure or function has too many arguments specified

Hi!
I am a newbie in building sp, and i get this error "Procedure or function sp_book_lci01 has too many arguments specified"

Can someone look at my code.
SQL = "sp_book_lci01 '"&SmallTitle1&"','"&Firstname1&"','"&Lastname1&"','"&Email1&"','"&Mobile1&"','"&FaktPostnr&"','"&FaktOrt&"','"&FaktLand&"','"&ClubName1&"','"&ClubNr1&"','"&TangentName1&"','"&TangentNr1&"','"&BoardPoss1&"','"&BoardYear1&"','"&OfficerPoss1&"','"&OfficerYear1&"','"&Member1&"','"&RTClubName1&"','"&RTClubNr1&"','"&OTClubName1&"','"&OTClubNr1&"','"&RTBordPoss1&"','"&RTBoardYear1&"','"&RTIntBoardPoss1&"','"&RTIntBoardYear1&"','"&Comments1&"','"&SmallTitle2&"','"&Firstname2&"','"&Lastname2&"','"&Email2&"','"&Mobile2&"','"&ClubName2&"','"&ClubNr2&"','"&TangentName2&"','"&TangentNr2&"','"&BoardPoss2&"','"&BoardYear2&"','"&OfficerPoss2&"','"&OfficerYear2&"','"&Member2&"','"&RTClubName2&"','"&RTClubNr2&"','"&OTClubName2&"','"&OTClubNr2&"','"&RTBordPoss2&"','"&RTBoardYear2&"','"&RTIntBoardPoss2&"','"&RTIntBoardYear2&"','"&Comments2&"','"&CustParticipantId&"','"&myIDMod&"'"

Open in new window

USE [ICESQL]
GO
/****** Object:  StoredProcedure [MickeC_ICE].[sp_book_lci01]    Script Date: 10/17/2011 18:41:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Micke Carlsson
-- Create date: 2011-10-17
-- Description:	book_lci01
-- =============================================
ALTER PROCEDURE [MickeC_ICE].[sp_book_lci01] 
@SmallTitle1PZMc4138 nvarchar(6),
@Firstname1PZMc4138 nvarchar(50),
@Lastname1PZMc4138 nvarchar(50),
@Email1PZMc4138 nvarchar(40),
@Mobile1PZMc4138 nvarchar(30),
@FaktPostnrPZMc4138 nvarchar(20),
@FaktOrtPZMc4138 nvarchar(50),
@FaktLandPZMc4138 nvarchar(30),
@ClubName1PZMc4138 nvarchar(50),
@ClubNr1PZMc4138 nvarchar(50),
@TangentName1PZMc4138 nvarchar(50),
@TangentNr1PZMc4138 nvarchar(50),
@BoardPoss1PZMc4138 nvarchar(50),
@BoardYear1PZMc4138 int,
@OfficerPoss1PZMc4138 nvarchar(50),
@OfficerYear1PZMc4138 int,
@Member1PZMc4138 nvarchar(30),
@RTClubName1PZMc4138 nvarchar(50),
@RTClubNr1PZMc4138 nvarchar(50),
@OTClubName1PZMc4138 nvarchar(50),
@OTClubNr1PZMc4138 nvarchar(50),
@RTBordPoss1PZMc4138 nvarchar(50),
@RTBoardYear1PZMc4138 int,
@RTIntBoardPoss1PZMc4138 nvarchar(50),
@RTIntBoardYear1PZMc4138 int,
@Comments1PZMc4138 nvarchar(100),
@SmallTitle2PZMc4138 nvarchar(6),
@Firstname2PZMc4138 nvarchar(50),
@Lastname2PZMc4138 nvarchar(50),
@Email2PZMc4138 nvarchar(40),
@Mobile2PZMc4138 nvarchar(30),
@ClubName2PZMc4138 nvarchar(50),
@ClubNr2PZMc4138 nvarchar(50),
@TangentName2PZMc4138 nvarchar(50),
@TangentNr2PZMc4138 nvarchar(50),
@BoardPoss2PZMc4138 nvarchar(50),
@BoardYear2PZMc4138 int,
@OfficerPoss2PZMc4138 nvarchar(50),
@OfficerYear2PZMc4138 int,
@Member2PZMc4138 nvarchar(30),
@RTClubName2PZMc4138 nvarchar(50),
@RTClubNr2PZMc4138 nvarchar(50),
@OTClubName2PZMc4138 nvarchar(50),
@OTClubNr2PZMc4138 nvarchar(50),
@RTBordPoss2PZMc4138 nvarchar(50),
@RTBoardYear2PZMc4138 int,
@RTIntBoardPoss2PZMc4138 nvarchar(50),
@RTIntBoardYear2PZMc4138 int,
@Comments2PZMc4138 nvarchar(100),
@myIDModPZMc4138 int
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
INSERT INTO TblCustBook(CustBookSmallTitle1,CustBookFirstname1,CustBookLastname1,CustBookEmail1,CustBookMobile1,CustBookFaktPostnr,CustBookFaktOrt,CustBookFaktLand,CustBookClubName1,CustBookClubNr1,CustBookTangentName1,CustBookTangentNr1,CustBookBoardPoss1,CustBookBoardYear1,CustBookOfficerPoss1,CustBookOfficerYear1,CustBookMember1,CustBookRTClubName1,CustBookRTClubNr1,CustBookOTClubName1,CustBookOTClubNr1,CustBookRTBordPoss1,CustBookRTBoardYear1,CustBookRTIntBoardPoss1,CustBookRTIntBoardYear1,CustBookComments1,CustBookSmallTitle2,CustBookFirstname2,CustBookLastname2,CustBookEmail2,CustBookMobile2,CustBookClubName2,CustBookClubNr2,CustBookTangentName2,CustBookTangentNr2,CustBookBoardPoss2,CustBookBoardYear2,CustBookOfficerPoss2,CustBookOfficerYear2,CustBookMember2,CustBookRTClubName2,CustBookRTClubNr2,CustBookOTClubName2,CustBookOTClubNr2,CustBookRTBordPoss2,CustBookRTBoardYear2,CustBookRTIntBoardPoss2,CustBookRTIntBoardYear2,CustBookComments2,CustBookRum,CustBookProjectId)
VALUES (@SmallTitle1PZMc4138,@Firstname1PZMc4138,@Lastname1PZMc4138,@Email1PZMc4138,@Mobile1PZMc4138,@FaktPostnrPZMc4138,@FaktOrtPZMc4138,@FaktLandPZMc4138,@ClubName1PZMc4138,@ClubNr1PZMc4138,@TangentName1PZMc4138,@TangentNr1PZMc4138,@BoardPoss1PZMc4138,@BoardYear1PZMc4138,@OfficerPoss1PZMc4138,@OfficerYear1PZMc4138,@Member1PZMc4138,@RTClubName1PZMc4138,@RTClubNr1PZMc4138,@OTClubName1PZMc4138,@OTClubNr1PZMc4138,@RTBordPoss1PZMc4138,@RTBoardYear1PZMc4138,@RTIntBoardPoss1PZMc4138,@RTIntBoardYear1PZMc4138,@Comments1PZMc4138,@SmallTitle2PZMc4138,@Firstname2PZMc4138,@Lastname2PZMc4138,@Email2PZMc4138,@Mobile2PZMc4138,@ClubName2PZMc4138,@ClubNr2PZMc4138,@TangentName2PZMc4138,@TangentNr2PZMc4138,@BoardPoss2PZMc4138,@BoardYear2PZMc4138,@OfficerPoss2PZMc4138,@OfficerYear2PZMc4138,@Member2PZMc4138,@RTClubName2PZMc4138,@RTClubNr2PZMc4138,@OTClubName2PZMc4138,@OTClubNr2PZMc4138,@RTBordPoss2PZMc4138,@RTBoardYear2PZMc4138,@RTIntBoardPoss2PZMc4138,@RTIntBoardYear2PZMc4138,@Comments2PZMc4138,@myIDModPZMc4138,'10')
END

Open in new window

0
MickeC
Asked:
MickeC
  • 2
1 Solution
 
sammySeltzerCommented:
Your stored procedure has 51 arguments.

Your call to the stored proc has 52.

SO, check to see what you may have added additionally.
0
 
sammySeltzerCommented:
I think the problem is on your call to the stored proc.

see bolded.


ALTER PROCEDURE [MickeC_ICE].[sp_book_lci01]
@SmallTitle1PZMc4138 nvarchar(6),
@Firstname1PZMc4138 nvarchar(50),
@Lastname1PZMc4138 nvarchar(50),
@Email1PZMc4138 nvarchar(40),
@Mobile1PZMc4138 nvarchar(30),
@FaktPostnrPZMc4138 nvarchar(20),
@FaktOrtPZMc4138 nvarchar(50),
@FaktLandPZMc4138 nvarchar(30),
@ClubName1PZMc4138 nvarchar(50),
@ClubNr1PZMc4138 nvarchar(50),
@TangentName1PZMc4138 nvarchar(50),
@TangentNr1PZMc4138 nvarchar(50),
@BoardPoss1PZMc4138 nvarchar(50),
@BoardYear1PZMc4138 int,
@OfficerPoss1PZMc4138 nvarchar(50),
@OfficerYear1PZMc4138 int,
@Member1PZMc4138 nvarchar(30),
@RTClubName1PZMc4138 nvarchar(50),
@RTClubNr1PZMc4138 nvarchar(50),
@OTClubName1PZMc4138 nvarchar(50),
@OTClubNr1PZMc4138 nvarchar(50),
@RTBordPoss1PZMc4138 nvarchar(50),
@RTBoardYear1PZMc4138 int,
@RTIntBoardPoss1PZMc4138 nvarchar(50),
@RTIntBoardYear1PZMc4138 int,
@Comments1PZMc4138 nvarchar(100),
@SmallTitle2PZMc4138 nvarchar(6),
@Firstname2PZMc4138 nvarchar(50),
@Lastname2PZMc4138 nvarchar(50),
@Email2PZMc4138 nvarchar(40),
@Mobile2PZMc4138 nvarchar(30),
@ClubName2PZMc4138 nvarchar(50),
@ClubNr2PZMc4138 nvarchar(50),
@TangentName2PZMc4138 nvarchar(50),
@TangentNr2PZMc4138 nvarchar(50),
@BoardPoss2PZMc4138 nvarchar(50),
@BoardYear2PZMc4138 int,
@OfficerPoss2PZMc4138 nvarchar(50),
@OfficerYear2PZMc4138 int,
@Member2PZMc4138 nvarchar(30),
@RTClubName2PZMc4138 nvarchar(50),
@RTClubNr2PZMc4138 nvarchar(50),
@OTClubName2PZMc4138 nvarchar(50),
@OTClubNr2PZMc4138 nvarchar(50),
@RTBordPoss2PZMc4138 nvarchar(50),
@RTBoardYear2PZMc4138 int,
@RTIntBoardPoss2PZMc4138 nvarchar(50),
@RTIntBoardYear2PZMc4138 int,
@Comments2PZMc4138 nvarchar(100),
@myIDModPZMc4138 int

(51 total)

versus

SQL = "sp_book_lci01
'"&SmallTitle1&"',
'"&Firstname1&"',
'"&Lastname1&"',
'"&Email1&"',
'"&Mobile1&"',
'"&FaktPostnr&"',
'"&FaktOrt&"',
'"&FaktLand&"',
'"&ClubName1&"',
'"&ClubNr1&"',
'"&TangentName1&"',
'"&TangentNr1&"',
'"&BoardPoss1&"',
'"&BoardYear1&"',
'"&OfficerPoss1&"',
'"&OfficerYear1&"',
'"&Member1&"',
'"&RTClubName1&"',
'"&RTClubNr1&"',
'"&OTClubName1&"',
'"&OTClubNr1&"',
'"&RTBordPoss1&"',
'"&RTBoardYear1&"',
'"&RTIntBoardPoss1&"',
'"&RTIntBoardYear1&"',
'"&Comments1&"',
'"&SmallTitle2&"',
'"&Firstname2&"',
'"&Lastname2&"',
'"&Email2&"',
'"&Mobile2&"',
'"&ClubName2&"',
'"&ClubNr2&"',
'"&TangentName2&"',
'"&TangentNr2&"',
'"&BoardPoss2&"',
'"&BoardYear2&"',
'"&OfficerPoss2&"',
'"&OfficerYear2&"',
'"&Member2&"',
'"&RTClubName2&"',
'"&RTClubNr2&"',
'"&OTClubName2&"',
'"&OTClubNr2&"',
'"&RTBordPoss2&"',
'"&RTBoardYear2&"',
'"&RTIntBoardPoss2&"',
'"&RTIntBoardYear2&"',
'"&Comments2&"',
'"&CustParticipantId&"','"&myIDMod&"'"

(52 total and it is in the bolded text)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now