I have a simple update query, only one table involved. I first wrote this without using CFQUERYPARAM and kept getting errors when the integer fields (zip,plus 4, etc) were null. So, I rewrote using CFQUERYPARAM so that the null values didn't produce the errors. Now, when I enter something into the integer fields, the data does not get saved.
What am I missing?
Thanks
DW
<cfquery name="updt_person" datasource="#application.datasource#">
UPDATE tblperson
SET
firstname = '#form.firstname#',
lastname = '#form.lastname#',
address_line_1 = '#form.address_line_1#',
address_line_2 = '#form.address_line_2#',
city = '#form.city#',
stateid = #form.stateid#,
zip = <cfqueryparam value = "#form.zip#" cfsqltype = "CF_SQL_INTEGER" null = "yes">,
plus4 = <cfqueryparam value = "#form.plus4#" cfsqltype = "CF_SQL_INTEGER" null = "yes">,
area_code = <cfqueryparam value = "#form.area_code#" cfsqltype = "CF_SQL_INTEGER" null = "yes">,
prefix = <cfqueryparam value = "#form.prefix#" cfsqltype = "CF_SQL_INTEGER" null = "yes">,
suffix = <cfqueryparam value = "#form.suffix#" cfsqltype = "CF_SQL_INTEGER" null = "yes">
WHERE personid = #get_personid.personid#
</cfquery>