Search code examples
coldfusion-11

cfprocparam is throwing ILLEGAL SYMBOL =;


Upgraded from CF10 to CF11 update 5 ( with hotfix hf1100-3971083.jar ) DB (DB2 v10.2)

getting an error on code that calls a stored proc.

Error Executing Database Query.
[Macromedia][DB2 JDBC Driver][DB2]ILLEGAL SYMBOL =;  
The error occurred in ...: line 238
236 :  <cfstoredproc datasource="#application.dsn#" procedure="LIVE.SP" >
237 :     <cfprocparam type="In" cfsqltype="CF_SQL_BIGINT" dbvarname="STOPID" null="yes" />
238 :     <cfprocparam type="In" cfsqltype="CF_SQL_INTEGER" dbvarname="POID" null="no" value="#val( qry.id )#" />
239 :  </cfstoredproc>

The actual code looks like this - and works fine in CF10....

"qry" IS returning a value for "id"

<cfloop query="qry" >

    <cfstoredproc datasource="#application.dsn#" procedure="LIVE.SP" >

        <cfprocparam type="In" cfsqltype="CF_SQL_BIGINT" dbvarname="STOPID" null="yes" />

        <cfprocparam type="In" cfsqltype="CF_SQL_INTEGER" dbvarname="POID" null="no" value="#val( qry.id )#" />

    </cfstoredproc>

</cfloop>

This happens IF or NOT the 'debugging' is turned on (per hotfix hf1100-3971083.jar)

It seems there are others claiming cfprocparam issues - but the solutions to those issues are not fixing THIS issue.

Any Ideas?


Solution

  • After a couple days of trying multiple suggestions from people. I removed the "dbvarname" arguments, made sure my arguments were an ordinal match to the procedure, and that gets me past the error.

    <cfstoredproc datasource="#application.dsn#" procedure="LIVE.SP" >
        <cfprocparam type="In" cfsqltype="CF_SQL_BIGINT" null="yes" />
        <cfprocparam type="In" cfsqltype="CF_SQL_INTEGER" null="no" value="#val( qry.id )#" />
    </cfstoredproc>
    

    This works without error. I can't say I LIKE the solution. but oh well. The other solution that probably would have worked was to use

    <cfquery...>
        call 'procName' ( arg => value, arg2 => val2 );
    </cfquery>
    

    however, this is legacy code which hopefully wont exist for more then a year longer (...hopefully...). So Im not going to fret about it.