tracker issue : CF-4014578

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

QueryExecute named params cannot start with a previous param's name

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/Duplicate

Reporter/Name(from Bugbase): Kevin Morris / Kevin Morris (Kevin Morris)

Created: 06/30/2015

Components: Database

Versions: 11.0

Failure Type: Non Functioning

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Major / Some users will encounter

Locale/System: English / Win 2008 Enterprise Svr 64-bit

Vote Count: 8

Duplicate ID:	CF-3943345

Problem Description:

When using queryExecute() with a SQL statement that includes multiple named parameters, the parser breaks on the second parameter whose name starts with a previous parameter’s name.

Steps to Reproduce:

local.sql = "
	INSERT INTO testTable
		(url
		,urlVariables)
	VALUES
		(:url
		,:urlVariables);
";
local.params = {
	"url" = {value="http://www.example.com/test.cfm", cfsqltype="cf_sql_varchar", maxLength="8000"},
	"urlVariables" = {value="?some=query&string=from&the=browser", cfsqltype="cf_sql_varchar", maxLength="8000"}
};
queryExecute(local.sql, local.params, {result="local.qryInsert"});

Actual Result:

Error Executing Database Query.
Incorrect syntax near 'Variables'.

Expected Result:

A normal query execution without error.

Any Workarounds:

Reorder the parameters so that the longer names come first. Example:

local.sql = "
	INSERT INTO testTable
		(urlVariables
		,url)
	VALUES
		(:urlVariables
		,:url);
";
local.params = {
	"url" = {value="http://www.example.com/test.cfm", cfsqltype="cf_sql_varchar", maxLength="8000"},
	"urlVariables" = {value="?some=query&string=from&the=browser", cfsqltype="cf_sql_varchar", maxLength="8000"}
};
queryExecute(local.sql, local.params, {result="local.qryInsert"});

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

Watson Bug ID:	4014578

External Customer Info:
External Company:  
External Customer Name: Kevin
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments:

+1 Please explain in 25 characters or more how this bug impacts productivity and why you are adding a vote.
Vote by External U.
6832 | June 30, 2015 07:17:07 AM GMT
Parameter naming shouldn't be an issue beyond reserved words.
Vote by External U.
6833 | June 30, 2015 07:22:13 AM GMT
Looks very similar to https://bugbase.adobe.com/index.cfm?event=bug&id=CF-3943345, and definitely needs to be fixed!
Comment by External U.
6830 | June 30, 2015 07:32:14 AM GMT
Parameters need to be able to have substrings of other parameters! This is a very common practice across languages.
Vote by External U.
6834 | June 30, 2015 07:33:12 AM GMT
I should have used 'foo' and 'bar' in my example code instead of my actual parameter names. I have confirmed that this issue is NOT a conflict with the 'url' scope or reserved keyword.
Comment by External U.
6831 | June 30, 2015 07:36:48 AM GMT
Please explain in 25 characters or more how this bug impacts productivity and why you are adding a vote.
Vote by External U.
6835 | June 30, 2015 07:40:11 AM GMT
Please explain in 25 characters or more how this bug impacts productivity and why you are adding a vote.
Vote by External U.
6836 | June 30, 2015 08:44:35 AM GMT
Please explain in 25 characters or more how this bug impacts productivity and why you are adding a vote.
Vote by External U.
6837 | June 30, 2015 09:01:45 AM GMT
.etov a gnidda era uoy yhw dna ytivitcudorp stcapmi gub siht woh erom ro sretcarahc 52 ni nialpxe esaelP
Vote by External U.
6838 | June 30, 2015 11:49:55 AM GMT
+1 Please explain in 25 characters or more how this bug impacts productivity and why you are adding a vote.
Vote by External U.
6839 | June 30, 2015 01:14:01 PM GMT