Skip to main content
April 21, 2009
Question

Procedure or function has too many arguments specified.

  • April 21, 2009
  • 1 reply
  • 1214 views

I am getting the error when I add a parameter to a Cold Fusion program and a stored procedure. If I take the comments out, I get error.

What am I doing wrong?

This is the ColdFusion part.

      <cfset service='test'>
      <cfset units=12.34>
      <cfset date1='12/25/08'>
      <cfset recid=100>

      <cfstoredproc procedure="try2" datasource="#dso#">
<!---         <cfprocparam cfsqltype="cf_sql_char" value="#served#"> --->
         <cfprocparam cfsqltype="cf_sql_float" value="#units#">
         <cfprocparam cfsqltype="cf_sql_datetime" value="#date1#">
         <cfprocparam cfsqltype="cf_sql_numeric" value="#recid#">
         <cfprocparam cfsqltype="cf_sql_numeric" type="out" variable="recs">
      </cfstoredproc>

This is the sql server part.

set

ANSI_NULLS ON

set

QUOTED_IDENTIFIER ON

GO

ALTER

PROCEDURE [dbo].[try2]

(

-- @11516412_served char,

@11516412_units

decimal(6,2),

@11516412_date1

datetime,

@11516412_recid

numeric,

@11516412_id2

int out

)

AS

BEGIN

SET NOCOUNT ON;

update table1 set units=@arg_units, date1=@arg_date1 where recid=@arg_recid;

select @11516412_id2=@@rowcount;

END

    This topic has been closed for replies.

    1 reply

    Inspiring
    April 21, 2009

    The first thing that jumps out is that the CF variable is called "service" and the cfprocparam is called "served". But I think the real issue is @arg_served char is one character in length so you need to add a length such as @arg_served char(10) to pass in a value of "test".