Hello Everyone (again):
Another form of cfqueryparam has come up and I was curious how your outcomes
might pan out.
The following cfqueryparam passes, BUT when NULL it passes the default date in
SQL Server (01/01/1900) Also, I had to take out the cfsqltype, it would error
out if I did.
Subject: Re: cfqueryparam question (null attribute)
Hello Everyone (again):
Another form of cfqueryparam has come up and I was curious how your
outcomes might pan out.
The following cfqueryparam passes, BUT when NULL it passes the default
date in SQL Server (01/01/1900) Also, I had to take out
Sean, I'm pretty sure I already know this answer, but now that you've brought
this new way of thinking to my attention. I'm going to place my cards on the
table here and ask the million dollar question. Is it possible to have a
cfelseif in this param? :-D I know... I have a pair of 4's...
You can nest ternary operators, I believe, but it is going to start
getting pretty unreadable quickly. If you have more logic to run, I'd
suggest pulling it up out of the sql statement, figuring out the final
result, then using that result in the conditional in your cfparam.
Cheers,
Judah
On
You can do nested iif, but not a full cfif/cfelseif/cfelse
-Original Message-
From: Matthew Lowrey rid...@gmail.com
Sent: Tuesday, May 04, 2010 12:26 PM
To: cf-talk cf-talk@houseoffusion.com
Subject: Re: cfqueryparam question (null attribute)
Sean, I'm pretty sure I already know
On Tue, May 4, 2010 at 12:40 PM, Judah McAuley ju...@wiredotter.com wrote:
You can nest ternary operators, I believe, but it is going to start
getting pretty unreadable quickly. If you have more logic to run, I'd
suggest pulling it up out of the sql statement, figuring out the final
result,
Thanks again everyone for your feedback.
Sean - Not to get off this subject, but I noticed your signature and realized
my boss and myself were on your site (getrailo.com) reviewing it because we
have been looking into trying to get some kind of internal wiki for mainly
having search-able
On Tue, May 4, 2010 at 4:17 PM, Matthew Lowrey rid...@gmail.com wrote:
Sean - Not to get off this subject, but I noticed your signature and realized
my boss and myself were on your site (getrailo.com) reviewing it because we
have been looking into trying to get some kind of internal wiki for
This is getting to be quite an interesting challenge. All the examples I've
seen logically make sense but none of them have worked so far. I will say I'm
learning quite a bit from everyone's knowledge/wisdom. I will try and list
here all the different methods I've tried out and have failed.
I think the point is that if you're going to use any of those techniques,
you DO have to param the variable, or use some other mechanism to make sure
the variable exists. Otherwise the code in your value attribute will
always fail when the variable doesn't exist. Make sense?
On Mon, May 3, 2010
I think the point is that if you're going to use any of those techniques,
you DO have to param the variable, or use some other mechanism to make sure
the variable exists. Otherwise the code in your value attribute will
always fail when the variable doesn't exist. Make sense?
Yes. This is the
=#NOT
isNumeric(form.myVar)# /
because value=#form.myVar# will fail to compile if form.myVar doesn't
exist.
From: Dave Watts dwa...@figleaf.com
Sent: Monday, May 03, 2010 12:05 PM
To: cf-talk cf-talk@houseoffusion.com
Subject: Re: cfqueryparam question (null
Since you're on CF9:
cfqueryparam value=#isDefined('form.myVar')?form.myVar:''#
null=#!isDefined('form.myVar')# /
The (new in CF9) ?: operator only evaluates the true-expr if the
condition is true.
On Mon, May 3, 2010 at 8:12 AM, Matthew Lowrey rid...@gmail.com wrote:
This is getting to be
YA SEAN WINS THE PRIZE!! Thank you Mr. Corfield. This
worked beautifully and better yet I didn't have to set anything or cfif
anything, just one tag with everything all inside of it. Thanks a million x
yourVal
Matt...
Since you're on CF9:
cfqueryparam
what Dominic meant is that value=#somevalue# in cfqueryparam tag
cause the problem when somevalue var does not exist, not the
isDefined(somevalue) part.
Azadi
On 02/05/2010 06:12, Dave Watts wrote:
I believe the trouble to be this:
cfqueryparam value=#someValue# null=#not
what Dominic meant is that value=#somevalue# in cfqueryparam tag
cause the problem when somevalue var does not exist, not the
isDefined(somevalue) part.
Oh, well, yes - that would cause a problem! I didn't even think about that part.
Dave Watts, CTO, Fig Leaf Software
I believe the trouble to be this:
cfqueryparam value=#someValue# null=#not IsDefined('someValue')# /
Works fine when the value is defined. However, if the value is not defined,
value=#someValue# will throw an error - ColdFusion evaluating it
before/regardless of the value of the null
Hello everyone (if you're still alive) haha!
I notice the posting was dated back in 2004, now it's 2010 and I've come across
this article looking for a better way of choosing when an NULL value is entered
into my SQL Server.
I'm running CF9 and SQL Server I think is up to date as well
I notice the posting was dated back in 2004, now it's 2010 and I've come
across this article looking for a better way of choosing
when an NULL value is entered into my SQL Server.
I'm running CF9 and SQL Server I think is up to date as well (doesn't really
matter in this case I think)
cfqueryparam null=#len(form.field)eq 0# value=#form.field#
~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
Thanks Dave Tony. I must be doing something wrong, I don't know why it's not
working. The only way these tags work is if I do a cfparam with default=. I
keep getting the same undefined error. Both of your ideas logically make sense
and even the Not IsDefined() should work, that's what I
All ColdFusion expressions and functions will throw an undefined error,
if you reference a variable that is, you know, undefined even
expressions and functions used inside of the null property of the
cfqueryparam... tag.
If you expect that the variable is going to be undefined, as some form
I believe the trouble to be this:
cfqueryparam value=#someValue# null=#not IsDefined('someValue')# /
Works fine when the value is defined. However, if the value is not defined,
value=#someValue# will throw an error - ColdFusion evaluating it
before/regardless of the value of the null attribute.
If it is set to YES, the value attribute is ignored and a NULL is used. If
it is sent to NO, the value is used.
_
From: Jamie Jackson [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 19, 2004 2:36 PM
To: CF-Talk
Subject: cfqueryparam question (null attribute)
I'm not quite sure how the
The null attribute says that the value passed to the DB should be null,
regardless of what the value attribute says.For instance, if you have a
select box with a blank first option and the actual options have a numeric
value, you might use a CFQUERYPARAM like this:
cfqueryparam
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
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)))#
My situation exactly, thanks fellas.
Thanks,
cfqueryparam type=cf_sql_integer value=#form.myVar# isNull=#NOT
isNumeric(form.myVar)# /
That will insert the value provided, unless it's not numeric, in which case
it'll insert NULL.
Thanks Barney,
One small correction though: I don't think CF can evaluate:
#NOT isNumeric(form.myVar)#
It
It will handle it in CFMX but not CF5.
-Original Message-
From: Jamie Jackson [mailto:[EMAIL PROTECTED]
Sent: Friday, 20 February 2004 8:14 a.m.
To: CF-Talk
Subject: Re: cfqueryparam question (null attribute)
cfqueryparam type=cf_sql_integer value=#form.myVar# isNull=#NOT
isNumeric
, 2004 12:14 PM
To: CF-Talk
Subject: Re: cfqueryparam question (null attribute)
cfqueryparam type=cf_sql_integer value=#form.myVar# isNull=#NOT
isNumeric(form.myVar)# /
That will insert the value provided, unless it's not
numeric, in which case
it'll insert NULL.
Thanks Barney,
One
30 matches
Mail list logo