jump to navigation

NOTE: The spam filter is being unusually aggressive. If you comment does not immediately appear, it has simply been placed in moderation and I will approve it as quickly as possible. Thank you for your patience.

"Murphy was an optimist!"

Tech Issue of the Day July 26, 2007 1:37 pm

Posted by Doug McCaughan in : ColdFusion, Daily Life, MySQL, Programming, Technology
, trackback

Today’s terribly frustrating error causing a long delay in a short process is:

Parameter index out of range (1 > number of parameters, which is 0).

It is the result of this simple insert:

<cfquery name="createrole" datasource="#application.gDataSrc#">
    INSERT INTO #application.projectidentifier#_theroletable {
       fooASInt,
       barAsInt
    } VALUES {
       <cfqueryparam cfsqltype="CF_SQL_INTEGER" value="#fooAsIntValue#">,
       104
    }
</cfquery>

UPDATE: Whoops. I see the typo! There is a big difference between {} and (). Should have been:

<cfquery name="createrole" datasource="#application.gDataSrc#">
    INSERT INTO #application.projectidentifier#_theroletable (
       fooASInt,
       barAsInt
    ) VALUES (
       <cfqueryparam cfsqltype="CF_SQL_INTEGER" value="#fooAsIntValue#">,
       104
    )
</cfquery>

Comments after advertisement

Comments»

1. Barry - July 26, 2007

Well, I mean, duh…

2. Doug McCaughan - July 26, 2007

I was typing very fast when I did that 🙂


trackback