tracker issue : CF-3039096

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

Bug 78417:(Watson Migration Closure)<cfset me = demo() />

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/

Reporter/Name(from Bugbase): IT Support / Dale Fraser (Dale_Fraser)

Created: 06/30/2009

Components: Database, CFQuery

Versions: 9.0

Failure Type: Unspecified

Found In Build/Fixed In Build: 0000 /

Priority/Frequency: Normal / Unknown

Locale/System: English / Win All

Vote Count: 5

Problem:

<cfset me = demo() />

<cffunction name="demo">
    <cfquery name="local.test" datasource="research">
        select * from rsUser
        order by userName
    </cfquery>

    <cfquery name="local.qoq" dbtype="query">
        select * from local.test
        where userName > ’n’
    </cfquery>    

</cffunction>

This code doesn’t work, never has, not even in CF8, the reason is the local.test in the second select

Now, in CF8, you could get around this by doing

select * from [local].test

which is kinda ugly

In CF9, you can also now just do

select * from test

since the default scope is local it just works, but this is unclear where this is coming from, if you didn’t know any beter reading this code you would think that test was test in the variables scope

So I think it should be fixed to work as

select * from local.test

Method:


Result:

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

Watson Bug ID:	3039096

External Customer Info:
External Company:  
External Customer Name: Dale Fraser
External Customer Email: 66D97270447003E29920157F
External Test Config: 06/30/2009

Attachments:

Comments:

This bug has been voted..
Vote by External U.
23582 | November 10, 2011 06:56:15 PM GMT
+1 vote. I don't understand why QoQ can't simply read any CF variable name for the queries here. -- Adam
Vote by External U.
23583 | November 10, 2011 06:56:18 PM GMT
This bug has been voted..
Vote by External U.
23584 | November 10, 2011 06:56:20 PM GMT
This has always been a pain.
Vote by External U.
23585 | November 10, 2011 06:56:21 PM GMT
+1, I agree w/ this statement (from the forum thread): "ColdFusion server can automatically covert this to [local].queryName if it likes as local. will never work, so whey doesn’t it just do that." Related thread: https://prerelease.adobe.com/r/?8b7b005ac8d042bea87b10cf54aba6f5
Vote by External U.
23586 | November 10, 2011 06:56:23 PM GMT
This happens because local is also an SQL keyword. However you can use others scope variables just fine. Hope that helps.
Comment by Himavanth R.
23581 | November 18, 2014 06:51:07 AM GMT