tracker issue : CF-4173251

select a category, or use search below
(searches all categories and all time range)
Title:

Query scope descrepancy between tag and script

| View in Tracker

Status/Resolution/Reason: Closed/Won't Fix/Workaround

Reporter/Name(from Bugbase): Steve Sommers / Steve Sommers (Steve Sommers)

Created: 07/18/2016

Components: Language

Versions: 11.0

Failure Type: Non Functioning

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Major / Some users will encounter

Locale/System: ALL / Windows 7 SP1 64-bit

Vote Count: 0

Problem Description: I'm fairly certain I found a scope bug. I'm using CF11 and FW/1 and I have the following query -- the tag works, the cfscript equivalent triggers a "Table named rc.qSignerLinks was not found in memory" exception.

Steps to Reproduce:

/* works*/
<cfquery name="local.qResultSet" result="local.qResult" dbtype="query">

    SELECT

        *

    FROM

        rc.qRSRecipient

    where

        [email] = <cfqueryparam value="#session.user.getEmail()#" cfsqltype="CF_SQL_VARCHAR" maxlength="50" />

</cfquery>

 

/* exception */

<cfscript>

    local.qObj = new query();

    local.qObj.setDBType("query");

    local.qObj.setSQL("

        SELECT

            *

        FROM

            rc.qRSRecipient

        where

            [email] = :email

    ");

    local.qObj.addParam( name="email",value="#session.user.getEmail()#",cfsqltype="CF_SQL_VARCHAR",maxlength="50" );

    local.qObjResult = local.qObj.execute();

    local.qResultSet= local.qObjResult.getResult().recordCount NEQ 0;

</cfscript>

Actual Result: Exception

Expected Result: Both methods should have worked identically.

Any Workarounds: I recoded using the tag format. In the referenced thread below there was a suggestion to use SetAttributes. I have not confirmed this option works but it seems promising.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4173251

External Customer Info:
External Company:  
External Customer Name: Steve Sommers
External Customer Email:  
External Test Config: Windows 7 Ultimate 64-bit, IIS, CF11 11,0,07,296330 developers edition, Update Level chf11000007.jar, Java Version 1.7.0_55

Attachments:

Comments:

I started this forum thread on the same topichttps://forums.adobe.com/thread/2182274
Comment by External U.
2180 | July 18, 2016 10:49:27 AM GMT
Hi Steve, Have you tried using QueryExecute method which we introduced in ColdFusion 11? -Nimit
Comment by Nimit S.
2181 | July 22, 2016 12:09:04 AM GMT
Steve, Did you get a chance to try QueryExecute method?
Comment by Nimit S.
2182 | July 28, 2016 12:05:30 AM GMT
Steve, I recommend you to use QueryExecute method for cfscript.
Comment by Nimit S.
2183 | August 02, 2016 04:37:35 AM GMT