tracker issue : CF-3486277

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

Bug in Query.cfc

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Lance Shepard / Lance Shepard (my2centz)

Created: 01/21/2013

Components: Language, Script CFC

Versions: 9.0

Failure Type: Crash

Found In Build/Fixed In Build: 9.0 /

Priority/Frequency: Critical / All users will encounter

Locale/System: English / Win 2008 Server

Vote Count: 0

Problem Description: In an attempt to get a quoted value I have entered a valid sqlServer query into a query anaylzer which works as expected but if running the same query in cf I get the following error.

SQL QUERY
SELECT  '''' +email + '''' as email
FROM    users
where fname = @fname

Steps to Reproduce: 

var q = new Query(datasource="myDB");
q.setSQL("SELECT  '''' +email + '''' as email
                FROM users where firstName= :firstName ");
q.addParam(name="firstName", value=trim(firstName), cfsqltype="cf_sql_varchar");

Actual Result:
Email
+email+
+email+

Expected Result:
Email
'bozo@clowns.com'
'bozo2@clowns.com'


Any Workarounds:
Do not try to attempt adding the single quotes in the query.  Adding single quotes to the query results works

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

Watson Bug ID:	3486277

External Customer Info:
External Company:  
External Customer Name: my2centz
External Customer Email:  
External Test Config: SQL Server 2008 running on Windows 2008

Attachments:

Comments:

See this discussion between myself and Adam Cameron http://stackoverflow.com/questions/14408774/is-this-a-coldfusion-bug-in-cfscript/DVAPR-14417477
Comment by External U.
16717 | January 21, 2013 03:54:20 PM GMT
This is now possible with QueryExecute function in ColdFusion 11.
Comment by Nimit S.
16718 | August 18, 2014 10:30:38 PM GMT