Hello everyone (if you're still alive) haha!
I notice the posting was dated back in 2004, now it's 2010 and I've come across
this article looking for a better way of choosing when an NULL value is entered
into my SQL Server.
I'm running CF9 and SQL Server I think is up to date as well (doesn't really
matter in this case I think) Here's what I'm doing currently:
< cfif isDefined( " form.myVal " ) >< cfqueryparam ... value="form.myVal" ><
cfelse >< cfqueryparam null="yes >< /cfif >
Until today, I was content doing it, but, I started at this new company who has
not used cfqueryparams so we're having to go through all our websites and add
this in for security purposes. I wanted to look around to the updated way of
posting things and I wanted to check and see what NULL was. I found this
article and was happy to see a shorter way of doing things. I tried all the
options mentioned and none of them worked.
Anybody know why things aren't working? If I cfparam the variables to
default="" then it will go through, but.. again... more work. I might as well
just keep to the cfif isDefined method.
>It will handle it in CFMX but not CF5.
>
>
>
>><cfqueryparam type="cf_sql_integer" value="#form.myVar#" isNull="#NOT
>>isNumeric(form.myVar)#" />
>>
>>That will insert the value provided, unless it's not numeric, in which case
>>it'll insert NULL.
>
>Thanks Barney,
>
>One small correction though: I don't think CF can evaluate:
>#NOT isNumeric(form.myVar)#
>
>It seems you have to wrap "NOT {expression}" with a function, like:
>#yesNoFormat(NOT isNumeric(form.myVar))#
>
>Thanks,
>Jamie
>
> _____
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333280
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm