Hello. I'm executing the query with incorrect deci...
# lucee
r
Hello. I'm executing the query with incorrect decimal value ("6 5") in Lucee 5.3.10.120.
Copy code
<cfquery name="qryUpdateFTs" datasource="#pvtDSNInnovare#">
    UPDATE Policys2PrFeesTaxes
    SET 
        CommissionGANB = <cfqueryparam cfsqltype="CF_SQL_DECIMAL" value="6 5" scale="2">
    WHERE 
        Policy2PrFeeTaxID=<cfqueryparam cfsqltype="CF_SQL_INTEGER" value="2">   
</cfquery>
In debug I see (and in database):
Copy code
UPDATE Policys2PrFeesTaxes
	SET 
		CommissionGANB = 45082
	WHERE 
		Policy2PrFeeTaxID=2
ACF gives error "*Invalid data 6 5 for CFSQLTYPE CF_SQL_DECIMAL."* Is it bug in Lucee? What's the conversion algorithm converts "6 5" to "45082". I see incorrect value "36865.00" in database and need to understand what user has entered.
r
z
thanks!
a
I bet it's interpreting "6 5" as a date (Jun 5 1900?) and then covering that to a number of seconds.
Might be garbage-in, garbage-out rather than a bug. Maybe.
z
unusually, i'm totally happy with ACF behavior here
a
7f5c53cd786df9677ec1342a8c6d768a yup. GIGO. Not a bug.
Although it's crap that Lucee treats "6 5" as a date. It clearly isn't.
z
lucee never claimed to be an incel 🙂
a
OMG
Hahaha
Ugh. Didn't notice that only the guid for the trycf URL pasted y/day. https://trycf.com/scratch-pad/gist/7f5c53cd786df9677ec1342a8c6d768a
Copy code
x = "6 5"
y = x * 1
writeOutput(y & "<br>")
writeOutput(dateTimeFormat(y, "YYYY-mm-dd HH:nn:ss"))
Copy code
45082
2023-06-05 00:00:00