If the NULL atributes is set to true, then NULL will be passed to the
database.  If the NULL attributes is set to false (or omitted), then
the value of the VALUE attribute will be passed to the database. 
Here's a 'typical' usage:

<cfqueryparam cfsqltype="cf_sql_integer" value="#form.myNumberField#"
null="#NOT isNumeric(form.myNumberField)#" />

That'll pass the number in the database, unless the value isn't
numeric, in which case it will pass NULL.

cheers,
barneyb

On Mon, 07 Feb 2005 18:53:53 -0500, Claude Schneegans
<[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I'm not too sure I accurately understand the role of attribute null in
> the CFQUERYPARAM tag.
> Does it mean that if it is YES, when the VALUE attribute is empty, the
> query will use NULL instead of the empty string?
> 
> For instance, these two quries are about the same?
> INSERT INTO Clients (ClientName)
>     VALUES (<CFIF ClientName EQ "")>
>         <CFQUERYPARAM CFSQLTYPE="CF_SQL_VARCHAR" VALUE="#ClientName#">
>         <CFELSE>null</CFIF>)
> or...
> INSERT INTO Clients (ClientName)
>     VALUES (<CFQUERYPARAM CFSQLTYPE="CF_SQL_VARCHAR" NULL="yes"
> VALUE="#ClientName#">)
> 
> --

-- 
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/

Got Gmail? I have 50 invites.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:193493
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to