It's subtle, but values that return integers should always be tested against other integers. It's (mildly) bad form to rely on the fact that CF evaluates 0 as false, especially considering that when you think about it, what you're really writing is "0 is false". Implicit conversion or no, doesn't that look odd?
null="#Len(form.CustNo) is 0#" is really what you you're trying to test. Also, the YesNoFormat is unnecessary, since all that does is return a string containing "yes" or "no". These are then also implicitly converted into their boolean equivalents. Roland -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter J. Farrell Sent: Thursday, March 02, 2006 5:32 PM To: [email protected] Subject: Re: [CFCDev] OT: Empty fields passed as integer parameters Phillip Senn said the following on 3/2/2006 4:10 PM: > If I pass an empty field into a stored procedure like so: > <cfstoredproc procedure="myProcedure" datasource="#Application.DSN#"> > <cfprocparam type="in" cfsqltype="cf_sql_integer" value="#FORM.CustNo#"> > </cfstoredproc> > I get: > invalid data for cfsqltype cf_sql_integer. > > Is that right? > What technique should I use? > Try: <cfprocparam type="in" cfsqltype="cf_sql_integer" value="#FORM.CustNo#" null="#YesNoFormat(NOT Len(form.CustNo)))#" /> .Peter -- Peter J. Farrell :: Maestro Publishing Member Team Mach-II :: Member Team Fusion http://blog.maestropublishing.com Create boilerplate beans and transfer objects for ColdFusion! Fire up a cup of Rooibos! http://rooibos.maestropublishing.com/ ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com). An archive of the CFCDev list is available at www.mail-archive.com/[email protected] ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com). An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
