Skip to main content
Participating Frequently
July 12, 2008
Question

Stored Procedures and Error Message stating missing parameter - when it is not

  • July 12, 2008
  • 1 reply
  • 1260 views
HI there

I have a call to a SQL Server stored procedure that reads as follows:
------------------------------------------------------------------------------------------
<cfstoredproc procedure="insertNewRSS" datasource="rssfeeder" returncode="yes"
result="thisVariable" debug="yes">
<cfprocparam dbvarname="ID" value="#ID#" cfsqltype="CF_SQL_INTEGER">
<cfprocparam dbvarname="CREATEDDATE" value="#CREATEDDATE#" cfsqltype="cf_sql_date">
<cfprocparam dbvarname="COMMENTS" value="#COMMENTS#" cfsqltype="cf_sql_longvarchar">
------------------------------------------------------------------------------------------
The code above is preceeded by a call to an RSS feed, so it is populated.

The stored procedure that it calls reads as follows:

------------------------------------------------------------------------------------------

ALTER PROCEDURE [sa2].[insertNewRSS] (@ID int, @CREATEDDATE datetime,
@COMMENTS [nvarchar](max))
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 rssRaw
(ID, CreatedDate, Comments)
VALUES (@ID, @CREATEDDATE, @COMMENTS)
END

------------------------------------------------------------------------------------------
I receive the following error message, and cannot work out why it is being reported, when when the parameter is explicitly passed.

Error Executing Database Query. [Macromedia][SQLServer JDBC Driver][SQLServer]Procedure or function 'insertNewRSS' expects parameter '@COMMENTS', which was not supplied.

Does anyone have any ideas?

Regards

Me
    This topic has been closed for replies.

    1 reply

    Inspiring
    July 13, 2008
    does your <cfstoredproc> have a close tag </cfstoredproc> ?
    Participating Frequently
    July 13, 2008
    Fair call, I should have included it in the first place:

    --------------------------------------------
    <cfstoredproc procedure="insertNewRSS" datasource="rssfeeder" returncode="yes"
    result="thisVariable" debug="yes">
    <cfprocparam dbvarname="ID" value="#ID#" cfsqltype="CF_SQL_INTEGER">
    <cfprocparam dbvarname="CREATEDDATE" value="#CREATEDDATE#" cfsqltype="cf_sql_date">
    <cfprocparam dbvarname="RssLink" value="#RssLink#" cfsqltype="cf_sql_integer">
    <cfprocparam dbvarname="Title" value="#Title#" cfsqltype="cf_sql_longvarchar">

    </cfstoredproc>
    ----------------------------------------------
    Inspiring
    July 13, 2008
    quote:

    Originally posted by: Is this one taken?
    Fair call, I should have included it in the first place:

    --------------------------------------------
    <cfstoredproc procedure="insertNewRSS" datasource="rssfeeder" returncode="yes"
    result="thisVariable" debug="yes">
    <cfprocparam dbvarname="ID" value="#ID#" cfsqltype="CF_SQL_INTEGER">
    <cfprocparam dbvarname="CREATEDDATE" value="#CREATEDDATE#" cfsqltype="cf_sql_date">
    <cfprocparam dbvarname="RssLink" value="#RssLink#" cfsqltype="cf_sql_integer">
    <cfprocparam dbvarname="Title" value="#Title#" cfsqltype="cf_sql_longvarchar">

    </cfstoredproc>
    ----------------------------------------------



    How come that this <cfstoredproc> is different from the first post you made? This one has 4 parameters while the first one you posted has only three? And this one actually has no "COMMENTS" parameter being passed.