Re: cfqueryparam question (null attribute)

2010-07-06 Thread Matthew Lowrey
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.

RE: cfqueryparam question (null attribute)

2010-07-06 Thread DURETTE, STEVEN J (ATTASIAIT)
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

Re: cfqueryparam question (null attribute)

2010-05-04 Thread Matthew Lowrey
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...

Re: cfqueryparam question (null attribute)

2010-05-04 Thread Judah McAuley
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

RE: cfqueryparam question (null attribute)

2010-05-04 Thread William Seiter
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

Re: cfqueryparam question (null attribute)

2010-05-04 Thread Sean Corfield
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,

Re: cfqueryparam question (null attribute)

2010-05-04 Thread Matthew Lowrey
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

Re: cfqueryparam question (null attribute)

2010-05-04 Thread Sean Corfield
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

Re: cfqueryparam question (null attribute)

2010-05-03 Thread Matthew Lowrey
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.

Re: cfqueryparam question (null attribute)

2010-05-03 Thread Brian Kotek
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

Re: cfqueryparam question (null attribute)

2010-05-03 Thread Dave Watts
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

Re: cfqueryparam question (null attribute)

2010-05-03 Thread Jason Fisher
=#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

Re: cfqueryparam question (null attribute)

2010-05-03 Thread Sean Corfield
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

Re: cfqueryparam question (null attribute)

2010-05-03 Thread Matthew Lowrey
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

Re: cfqueryparam question (null attribute)

2010-05-02 Thread Azadi Saryev
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

Re: cfqueryparam question (null attribute)

2010-05-02 Thread Dave Watts
 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

Re: cfqueryparam question (null attribute)

2010-05-01 Thread Dave Watts
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

Re: cfqueryparam question (null attribute)

2010-04-30 Thread Matthew Lowrey
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

Re: cfqueryparam question (null attribute)

2010-04-30 Thread Dave Watts
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)  

Re: cfqueryparam question (null attribute)

2010-04-30 Thread Tony Bentley
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:

Re: cfqueryparam question (null attribute)

2010-04-30 Thread Matthew Lowrey
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

Re: cfqueryparam question (null attribute)

2010-04-30 Thread Ian Skinner
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

Re: cfqueryparam question (null attribute)

2010-04-30 Thread Dominic Watson
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.

RE: cfqueryparam question (null attribute)

2004-02-19 Thread Tangorre, Michael
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

RE: cfqueryparam question (null attribute)

2004-02-19 Thread Barney Boisvert
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

RE: cfqueryparam question (null attribute)

2004-02-19 Thread Dave Watts
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

Re: cfqueryparam question (null attribute)

2004-02-19 Thread Jamie Jackson
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,

Re: cfqueryparam question (null attribute)

2004-02-19 Thread Jamie Jackson
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

RE: cfqueryparam question (null attribute)

2004-02-19 Thread Matthew Walker
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

RE: cfqueryparam question (null attribute)

2004-02-19 Thread Barney Boisvert
, 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