Status/Resolution/Reason: Closed/Withdrawn/UserError
Reporter/Name(from Bugbase): Brian Coyne / Brian Coyne (Brian Coyne)
Created: 02/19/2016
Components: Database
Versions: 11.0
Failure Type:
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Major / All users will encounter
Locale/System: English / Win 2012 Server x64
Vote Count: 0
Issue: It appears that cfquery is ignoring the % in my sql query- The query works as expected in sql mgm studio and as expected in CF 9-
See attachment of how the output is on 9 vs 11
Below is what i posted on the Adobe Forum: they recommended i submit a bug
Good morning everyone! I am in the process of testing out my code after upgrade from CF 9 to CF 11 update 7, so far things are going quite well except for one feature that was not built by me for our intranet page- The feature is a quick search button that allows users to type and get auto suggest options- For example typing Form would bring up anything in out links database that has the word form in it. This works perfectly on CF9, on CF11 it works ( no errors) except for the query only pulls based on the first letter typed For Example previously I could type Interview and I would get multiple results with the word interview in it, now i type and i only get results that start with matching letters. Below is a screen show that may make more sense as well as part of our code- I have verfied in SQL mgm studio that the query outputs the correct information- I also ran code analyzer on this page and it came back with no issues
Also during the upgrade i exported the .car file from cf 9 into cf 11 so the settings should be the same- also like i said before it is not throwing errors- it works- just not with the fully correct results- my apologies if the code is not up to par- like i said i didn't write this!
CODE OUTPUT of CFC File
<cfcomponent>
<cfset ds="IntranetLinks">
<!--- Function to get the web pages from the database. Used for the Auto-Suggest --->
<cffunction name="lookupLink"
access="remote"
returntype="String"
hint="Lookup method for Ajax auto-suggest">
<cfargument name="search"
type="any"
required="false"
default="">
<cfset var data="">
<cfquery datasource="#ds#" name="data">
SELECT PageName
FROM dbo.links
WHERE UPPER(PageName) LIKE UPPER('%#ARGUMENTS.search#%')
ORDER BY PageName
</cfquery>
<cfreturn ValueList(data.PageName)>
</cffunction>
<!--- Function to get the URL from the database. Populates the hidden text box on the page and used in Javascript to go to the uRL --->
<cffunction name="GetURL"
access="remote"
returntype="String"
hint="Gets URL of Page - used for binding">
<cfargument name="search"
type="any"
required="false"
default="">
<cfset var data="">
<cfquery datasource="#ds#" name="data">
SELECT URL, PageName
FROM dbo.links
WHERE UPPER(PageName) LIKE UPPER('%#ARGUMENTS.search#%')
ORDER BY URL
</cfquery>
<cfreturn data.URL>
</cffunction>
</cfcomponent>
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4119914
External Customer Info:
External Company:
External Customer Name: Brian Coyne
External Customer Email:
External Test Config: CF 11 update 7
Server 2012 R2
Attachments:
- February 19, 2016 00:00:00: 1_Cf9-11.PNG
Comments: