|
Mailing Lists
|
Home / Groups / ColdFusion Talk (CF-Talk)
<cfqueryparam> question ("null" attribute)> I'm not quite sure how the null attribute works in <cfqueryparam> > > =========================== > From the docs: > null [Optional] [Default="No"] > Description: Whether parameter is passed as a null value. > *Yes: tag ignores the value attribute > *No > =========================== > > Can anyone give me an example of the "null" attribute put to good > use? Since CF and HTML don't have an idea of NULL, you may want to convert an empty string from an HTML form into a NULL value within the database. You could do it like this, I think: <cfqueryparam ... null="#YesNoFormat(NOT Len(Trim(Form.fieldname)))#"> Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ phone: 202-797-5496 fax: 202-797-5444 |
May 23, 2013
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||