tracker issue : CF-4202370

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

Bug while using queryExecute

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/CannotReproduce

Reporter/Name(from Bugbase): Gitesh Agrawal / ()

Created: 05/10/2018

Components: Database, CFQuery

Versions: 2016

Failure Type: Others

Found In Build/Fixed In Build: ColdFusion 2016 Update 6 /

Priority/Frequency: Normal / All users will encounter

Locale/System: / Windows 10 64 bit

Vote Count: 0

Problem Description:
If you pass parameters as structures to queryExecute and use parameter as xxxFrom the coldfuion 
interpret as xx as parameter and put space and than "FROM" text in the insert statement.

Steps to Reproduce:
I have a dao cfc which contains a function to insert the record 

public numeric function create(numeric column1Value=0, string reviewDateFrom="") {
var loc= {};
loc.parameters = {
			column1Value={value="#arguments.column1Value#", cfsqltype="cf_sql_integer", null="#arguments.column1Value EQ 0#"},
                         column2From={value="#arguments.column2From#", cfsqltype="cf_sql_date", null="#not len(arguments.column2From)#"}
		};

loc.sql = "
		INSERT INTO
				dbo.temp1
				(
					column1
                                       ,column2
				)
			VALUES
				(
                                :column1Value
				,:column2From
			)
		";

		loc.options = { result = "loc.qr" };

		queryExecute( loc.sql, loc.parameters, loc.options );

                return loc.qr.generatedKey;
}

When you call this function with correct paramteres 
create(20);

Actual Result:
Error [Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near the keyword 'From'.

Actuall the SQL is converted by the coldfusion as 
                          INSERT INTO
				dbo.temp1
 				(
                                       column1
                                       ,column2
				)
			VALUES
				(
					 (param 1) 
					, (param 2) From
  				)


Since the second parameter contains the 'From' word in the end which is some how causing it interpret as separate word rather than part of the parameter name. 

Expected Result:
Should insert the record


Any Workarounds:
change the column name to reviewFromDate

Attachments:

Comments:

public numeric function create(numeric column1Value=0, string reviewDateFrom="") { should be public numeric function create(numeric column1Value=0, string column2From="") {
Comment by Gitesh A.
27736 | May 10, 2018 01:35:40 PM GMT
Hi Gitesh, I tried reproducing this issue but unable to do so. I tried it on buildĀ 2016,0,06,308055. Can you please confirm, if you have tried it on the latest update? -Nimit ColdFusion Team
Comment by Nimit S.
29582 | May 12, 2018 06:43:19 PM GMT
Hi Gitesh, Can you please provide an update on this issue? Are you still facing this issue? If yes, is it possible to come on a call and assist me in investigating this issue further? -Nimit
Comment by Nimit S.
29583 | August 22, 2018 03:58:36 AM GMT
Hi Gitesh, Can you please provide an update on this issue? -Nimit
Comment by Nimit S.
29634 | August 29, 2018 05:49:00 PM GMT