Re: Working with cfqueryparam

2010-11-15 Thread Scott Brady
It probably shouldn't be used for columns that don't allow null values. On Sun, Nov 14, 2010 at 11:52 AM, David Moore dgmoor...@hotmail.com wrote: Should this be written in on every cfqueryparam as a failsafe or should other steps be taken so that is not needed? cribe.cfm

Re: Working with cfqueryparam

2010-11-14 Thread David Moore
null=#Trim(FORM.Contributed) EQ ''# I like this. I find this easier to read: null=#yesNoFormat(len(trim(form.contributed)))# just because the nested quotes can be confusing. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a

Re: Working with cfqueryparam

2010-11-14 Thread David Moore
Dave, I find this easier to read: null=#yesNoFormat(len(trim(form.contributed)))# I really like this in that is seems to be truer to the actual use of the variable as CF intended it to be used. To confirm what you are proposing, if form.contributed is NULL it will produce the following:

Re: Working with cfqueryparam

2010-11-14 Thread David Moore
I really appreciate everyone's input. This kind of documentation is very helpful for a lot of people. I have found CF-Talk to be the best CF resource available. Maybe some of the experts on this list can provide other examples of cfqueryparam uses that have been helpful, but not mentioned

Re: Working with cfqueryparam

2010-11-14 Thread Roger Austin
On 11/14/2010 1:52 PM, David Moore wrote: I find this easier to read: null=#yesNoFormat(len(trim(form.contributed)))# What about using null=#isDate(form.contributed)# ? It looks like you are assuming a valid date or an empty string. What if someone puts in foo into the form field? Perhaps you

Re: Working with cfqueryparam

2010-11-14 Thread David Moore
Roger, What about using null=#isDate(form.contributed)# ? Would you want to add the yesNoFormat before the isDate as in Dave's suggestion? As to the second part, I am checking using ColdFusion's cfform methods within cfinput prior to submitting the information. Would your suggestion be a good

Working with cfqueryparam

2010-11-12 Thread David Moore
Seems to me that there is a lot more to cfqueryparam than I have been utilizing. I built the following query using as many elements of cfqueryparam as I could find based on examples from CF-Talk and other resources. I would love to get expert opinion from those on this forum in an effort to

Re: Working with cfqueryparam

2010-11-12 Thread Dave Watts
Seems to me that there is a lot more to cfqueryparam than I have been utilizing. I built the following query using as many elements of cfqueryparam as I could find based on examples from CF-Talk and other resources. I would love to get expert opinion from those on this forum in an effort

Re: Working with cfqueryparam

2010-11-12 Thread David Moore
I guess the question would be, are there better or more proficient ways to write these cfqueryparams? I haven't been able to find a lot of complete documentation on the use of cfqueryparam. Just bits and pieces here and there. So I tried to build in as many instances and different uses as I

Re: Working with cfqueryparam

2010-11-12 Thread Dave Watts
I guess the question would be, are there better or more proficient ways to write these cfqueryparams? I haven't been able to find a lot of complete documentation on the use of cfqueryparam. Just bits and pieces here and there. So I tried to build in as many instances and different uses as

Re: Working with cfqueryparam

2010-11-12 Thread Matthew Lowrey
In addition to your examples, you'd also want to use CFQUERYPARAM any time you have any user-entered or untrusted data within a query - not just within INSERT/UPDATE/DELETE queries. Hi Dave: You already know about this thread because you're on it, but wanted to post it again in case these

Re: Working with cfqueryparam

2010-11-12 Thread James Holmes
In this; cfqueryparam cfsqltype=cf_sql_date value=#CreateODBCDateTime(Now())#/ CreateODBCDateTime() is unnecessary. Also; cfqueryparam cfsqltype=cf_sql_integer value=#Trim(FORM.Contributed)# null=#IIF(Trim(FORM.Contributed) EQ '', true, false)# can be reduced to this cfqueryparam

Re: Working with cfqueryparam

2010-11-12 Thread Michael Grant
null=#Trim(FORM.Contributed) EQ ''# I like this. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive:

Re: Working with cfqueryparam

2010-11-12 Thread Dave Watts
null=#Trim(FORM.Contributed) EQ ''# I like this. I find this easier to read: null=#yesNoFormat(len(trim(form.contributed)))# just because the nested quotes can be confusing. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a