Skip to main content
Inspiring
December 12, 2011
Answered

CF8 -> CF9 Migration : CfProcResult Issue

  • December 12, 2011
  • 2 replies
  • 1724 views

Hi Guys,

We recently migrated our cf8 application to a new server running cf9 and this piece of code is causing an absolute nightmare! I just don't understand what is happening (Obviously I've modified it a bit to protect sensitive information)

It exists within a cfc as part of the model glue framework (which is bad enough as it is).

I have checked our datasource setup to the old environment, its identical. Nor is there any reserve words...it's almost like the cfprocResult simply isn't setting the value.

The error we are getting is that results is a String and not actually a query.

<cfset var results = "" />

<cfif arguments.status EQ 'status1'>

    <cfstoredproc procedure="proc1" datasource="#_getConfig().getDsn()#">

        <cfif SESSION.role EQ "type1">

            <cfprocparam cfsqltype="cf_sql_integer" variable="var1" value="#SESSION.someVariable#">

        <cfelse>

            <cfprocparam cfsqltype="cf_sql_integer" variable="var2" value="#arguments.otherVariable#">

        </cfif>

        <cfprocresult name="results">

    </cfstoredproc>

<cfelseif arguments.status EQ 'status2'>

    <cfstoredproc procedure="proc2" datasource="#_getConfig().getDsn()#">

        <cfif SESSION.role EQ "type1">

            <cfprocparam cfsqltype="cf_sql_integer" variable="var1" value="#SESSION.somevariable#">

        <cfelse>

            <cfprocparam cfsqltype="cf_sql_integer" variable="var2" value="#arguments.otherVariable#">

        </cfif>

        <cfprocparam cfsqltype="cf_sql_varchar" variable="status" value="#arguments.status#" maxlength="100">

        <cfprocresult name="results">

    </cfstoredproc>

<cfelse>

    <cfstoredproc procedure="proc3" datasource="#_getConfig().getDsn()#">

        <cfif SESSION.role EQ "type1">

            <cfprocparam cfsqltype="cf_sql_integer" variable="var1" value="#SESSION.someVariable#">

        <cfelse>

            <cfprocparam cfsqltype="cf_sql_integer" variable="var2" value="#arguments.otherVariable#">

        </cfif>

        <cfprocparam cfsqltype="cf_sql_varchar" variable="status" value="#arguments.status#" maxlength="100">

        <cfprocresult name="results">

    </cfstoredproc>

</cfif>

<cfif SESSION.role EQ "type1">

    <cfquery name="results" dbtype="query">

        SELECT * FROM results WHERE column = '#SESSION.userID#' OR column IS NULL

    </cfquery>

</cfif>

Have I missed anything here? I'm not sure why this even happens. (Excuse the legacy code)

    This topic has been closed for replies.
    Correct answer parkerst

    The issue is resolved by installing ColdFusion 9.0.1.x

    The bug is #81153 as referenced here http://kb2.adobe.com/cps/847/cpsid_84726.html

    2 replies

    parkerstAuthorCorrect answer
    Inspiring
    December 12, 2011

    The issue is resolved by installing ColdFusion 9.0.1.x

    The bug is #81153 as referenced here http://kb2.adobe.com/cps/847/cpsid_84726.html

    parkerstAuthor
    Inspiring
    December 12, 2011

    The error we are getting is that results is a String and not actually a query.

    Sorry I should add that the error occurs in this piece of code

    <cfif SESSION.role EQ "type1">

        <cfquery name="results" dbtype="query">

            SELECT * FROM results WHERE column = '#SESSION.userID#' OR column IS NULL

        </cfquery>

    </cfif>

    when it gets to this point, results is still a string...

    Should also add that I have tried explicitly setting the resultSet variable to no avail.

    Additionally:

    The proc itself has no explicit return out, only CREATE AS BEGIN SELECT, however, this worked fine in the CF8 Environment

    Message was edited by: parkerst

    Community Expert
    December 12, 2011

    The error we are getting is that results is a String and not actually a query.

    Sorry I should add that the error occurs in this piece of code

    <cfif SESSION.role EQ "type1">

        <cfquery name="results" dbtype="query">

            SELECT * FROM results WHERE column = '#SESSION.userID#' OR column IS NULL

        </cfquery>

    </cfif>

    when it gets to this point, results is still a string...

    My guess would be that you're using "results" as the name of the query

    you're creating by selecting from "results".

    Dave Watts, CTO, Fig Leaf Software

    http://www.figleaf.com/

    http://training.figleaf.com/

    Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on

    GSA Schedule, and provides the highest caliber vendor-authorized

    instruction at our training centers, online, or onsite.

    Dave Watts, Eidolon LLC
    parkerstAuthor
    Inspiring
    December 12, 2011

    I considered this however, if I dump out results before the query of queries, it comes out as [empty string]

    odly enough, it works on my local environment too! Same cf version, same java version, same Database server version, identical database structure and data....but I'm missing some key component here which I don't understand.