In cfwheels Ver 2.0, I am getting an error:
Invalid data '' for CFSQLTYPE CF_SQL_INTEGER.
The error occurred in /wheels/model/adapters/cfquery.cfm: line 37 :
35 : Replace(PreserveSingleQuotes(local.$wheels.i), "[[comma]]", ",", "all")>#PreserveSingleQuotes(local.$wheels.i)#</cfif>#chr(13)##chr(10)#</cfloop><cfif arguments.limit>LIMIT #arguments.limit#<cfif
36 : arguments.offset>#chr(13)##chr(10)#OFFSET #arguments.offset#</cfif></cfif><cfif
37 : Len(arguments.comment)>#arguments.comment#</cfif></cfquery>
38 : <cfif StructKeyExists(local, arguments.debugName)>
39 : <cfset local.$wheels.rv.query = local[arguments.debugName]>
The "hack" solution is to add the "Val() function to the cfqueryparam
in /wheels/model/adapters/cfquery.cfm WHEN and IF the
<cfqueryparam
value="#Int(Val( fieldname...value ))#"
cfsqltype="cf_sql_integer"
/>Thanks to Ben Nadel and Tony Petruzzi for the solution, see https://www.bennadel.com/blog/1092-coldfusion-cfqueryparam-binding-vs-sql-execution.htm
To "hack" my solution, some where in /wheels/model/adapters/cfquery.cfm , I need to add some code like the following;
<cfif ( local.$wheels.???cfsqltype??? = "cf_sql_integer" ) ><cfqueryparam
value="#Int(Val( local.$wheels.???fieldname...value??? ))#"
cfsqltype="cf_sql_integer"
/><cfelse> ... </cfif>
--
You received this message because you are subscribed to the Google Groups "CFWheels" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cfwheels+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cfwheels/e772a880-4ae2-4f19-b88e-6b901b63c116%40googlegroups.com.
<!--- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --->
<cfif (false) > <!--- SKIP THIS CODE BELOW --->
<!--- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --->
. . . textField( ... )
<!--- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --->
</cfif> <!--- SKIP THIS CODE above --->
<!--- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ---> #hiddenField(objectName="pfstmt", property="id")#
(environment="development") AND in controller create() AND executing save() function, and primary key (aka "id" field) exists , --
You received this message because you are subscribed to the Google Groups "CFWheels" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cfwheels+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cfwheels/70d3b1a1-68e5-41f2-924f-4046fbef1a3e%40googlegroups.com.