Posted on

Tech Issue of the Day

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>

2 thoughts on “Tech Issue of the Day

  1. Well, I mean, duh…

  2. I was typing very fast when I did that 🙂

Leave a Reply