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 Tue, May 4, 2010 at 12:26 PM, Matthew Lowrey <rid...@gmail.com> wrote:
>
> 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... not likely to 
> beat your cards haha
>
> Matt...
>
>> 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 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 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.  First, the method I've used (and
>> > still using):
>> > >
>> > > <cfif isDefined("form.myVal")><cfqueryparam
>> > cfsqltype="cf_sql_varchar" value="#form.myVal#"
>> > maxlength="50"><cfelse><cfqueryparam
> null="yes"></c
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333328
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to