> For this:
> 
> <cfqueryparam
>     value="#myFORM.myVAR#"
>     cfsqltype="CF_SQL_CHAR"
>     maxlength="1">,
> 
> Two questions:
> 
> 1. If #myFORM.myVAR# doesn't exist, what's the best way to set a null?
> 
> This?
> 
> <cfqueryparam
>     value="#myFORM.myVAR#"
>     cfsqltype="CF_SQL_CHAR"
>     maxlength="1"
>     null = "#YesNoFormat(NOT Len(Trim(Form.ItemDesc)))#"

That's what I'd recommend.

> 2. What if I don't want a null? What if I want to assign a 
> default value? If #myFORM.myVAR# doesn't exist, I want the 
> value to be "N", not null, for example...

There are all kinds of ways you can deal with that, using the conditional
logic construct of your choice.

<cfif not Len(Trim(Form.myVar))>
        <cfset Form.myVar = "N">
</cfif>

....

<cfqueryparam value="#Form.myVar#" ...>

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:312448
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to