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
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
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:
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
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
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
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
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
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
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
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
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
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:
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
14 matches
Mail list logo