Simone
03/30/2022, 7:48 PM<cfqueryparam cfsqltype="cf_sql_integer" value="#form.id#" null="#NOT len(trim(form.id))#">Myka Forrest
03/30/2022, 7:56 PMform.id is not defined? The null attribute determines whether or not to send a null to the BD. If you want to send 0, the null attribute won't be used. Check your form.id and use the value to send form.id or 0.Michael Gillespie
03/30/2022, 8:40 PM<cfqueryparam cfsqltype="cf_sql_integer" value="#form.id#" null="#iif(len(trim(form.id)) eq 0,DE('true'),DE('false'))#">Myka Forrest
03/30/2022, 8:43 PMlen(trim(form.id)) eq 0 and not bother with the iif(...)?Michael Gillespie
03/30/2022, 8:45 PMSimone
03/30/2022, 9:06 PMVALMyka Forrest
03/30/2022, 9:06 PMform.id isn't defined, val() wouldn't workMyka Forrest
03/30/2022, 9:08 PMiif(...) syntaxMichael Gillespie
03/30/2022, 9:14 PMcfvonner
03/31/2022, 3:53 PMhow can i add 0 in cfqueryparam if no value is defined using a NULL attributeCan you clarify "no value is defined"? Do you mean the
id key might not exist in the form scope? Or that it is empty? I can't think of a scenario where form.id would actually be NULL.