Hey all,
I'm working on an asset tracking system and once again I've found myself
using the CFGRID to be able to edit serveral items at once and then save.
In the past week we've migrated to SQL Server 2005. I am having an issue
with saving NULL values to the db. I just read Charlie's blog from 3/5/2007
where he discussed the NULL attribute for CFQUERYPARAM. Before this, I was
using if else logic to enter NULL values into the db but was having an issue
with them being written to the db as "null" (as in the string). Obviously
this is less than ideal.
Any ideas what I'm doing wrong?
Here is a snippet of the code (the actual query covers about 25 different
fields):
<CFCASE value="U">
<CFQUERY name="update" datasource="intranet">
UPDATE tblNAOB
SET
purchasedate= <CFQUERYPARAM cfsqltype="CF_SQL_TIMESTAMP"
value="#Form.assetgrid.purchasedate[Row]#" NULL="#yesNoFormat(NOT len(trim(
Form.assetgrid.purchasedate[Row])))#">,
POnumber= <CFQUERYPARAM cfsqltype="CF_SQL_VARCHAR"
value="#Form.assetgrid.POnumber[Row]#" NULL="#yesNoFormat(NOT len(trim(
Form.assetgrid.POnumber[Row])))#">,
equiptype= <CFQUERYPARAM cfsqltype="CF_SQL_VARCHAR"
value="#Form.assetgrid.equiptype[Row]#" NULL="#yesNoFormat(NOT len(trim(
Form.assetgrid.equiptype[Row])))#">,
manufacturer= <CFQUERYPARAM cfsqltype="CF_SQL_VARCHAR"
value="#Form.assetgrid.manufacturer[Row]#" NULL="#yesNoFormat(NOT len(trim(
Form.assetgrid.manufacturer[Row])))#">,
brandname= <CFQUERYPARAM cfsqltype="CF_SQL_VARCHAR"
value="#Form.assetgrid.brandname[Row]#" NULL="#yesNoFormat(NOT len(trim(
Form.assetgrid.brandname[Row])))#">,
model= <CFQUERYPARAM cfsqltype="CF_SQL_VARCHAR"
value="#Form.assetgrid.model[Row]#" NULL="#yesNoFormat(NOT len(trim(
Form.assetgrid.model[Row])))#">,
serialnumber= <CFQUERYPARAM cfsqltype="CF_SQL_VARCHAR"
value="#Form.assetgrid.serialnumber[Row]#" NULL="#yesNoFormat(NOT len(trim(
Form.assetgrid.serialnumber[Row])))#">,
assettag= <CFQUERYPARAM cfsqltype="CF_SQL_VARCHAR"
value="#Form.assetgrid.assettag[Row]#" NULL="#yesNoFormat(NOT len(trim(
Form.assetgrid.assettag[Row])))#">,
owner= <CFQUERYPARAM cfsqltype="CF_SQL_VARCHAR"
value="#Form.assetgrid.owner[Row]#" NULL="#yesNoFormat(NOT len(trim(
Form.assetgrid.owner[Row])))#">
WHERE assetID=#Form.assetgrid.assetID[Row]#
</CFQUERY>
</CFCASE>
Bottom line, why is isnerting the string "null" into my db instead of
<NULL>???
Is this a SQL Server 2005 issue?
-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform
For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------