You're version of getting NULL into the DB will work but you don't need the
YesNoFormat() as NOT Len(...) with evaluate the same way as yes or no.

About your query, do:

<cfif NOT Len(Trim(FORM.someVar))>
        <cfset FORM.someVar = "N">
</cfif>

Adrian

-----Original Message-----
From: Les Mizzell [mailto:[EMAIL PROTECTED]
Sent: 12 September 2008 17:01
To: CF-Talk
Subject: A Little Confusion on CFQUERYPARAM and Nulls...


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)))#"


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...


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:312449
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