<CFQUERYPARAM Null attribute did not work!
Hi All!
From what I learned, cfqueryparam's null attribute should be very useful for this scenario:
<CFIF IsDefined("Form.Name") AND Form.Name NEQ "">
Do this
<CFELSE>
Do That
</CFIF>
With the null attribute from cfqueryparam, we can write a clean and more elegant code like this:
<CFIF IsDefined("Form.Name") AND Form.Name NEQ "">
<CFQUERYPARAM cfsqltype="cf_sql_varchar" value="#Trim(Form.Name)#" null="#NOT Len(Trim(Form.Name))#">
</CFIF>
But when I tried it on my INSERT statement, I got error message saying that the amount of columns don't match it's values. I counted more than once
they exactly matched up.
I modified the same insert statement with values changed to use cfiif cfelse method, it worked. When I changed it back to use cfqueryparam and its null attribute, it did not work again because when form.name is blank/null, cfqueryparam did not insert the NULL value the way cfif Isdefined expression does
I also tried using yesNoFormat and still did not work.
Is this a bug?
