Status/Resolution/Reason: Closed/Withdrawn/CannotReproduce
Reporter/Name(from Bugbase): Gitesh Agrawal / ()
Created: 05/10/2018
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: