Matthew,
SQL should have no problem with a null being passed for a list, even with
integers (I just tested this against MS SQL Server 2005, although I use
BlueDragon JX 7.1 instead of ACF).
If you are using the null="#!isDefined('myVar')#" attribute in your
cfqueryparam, then a SQL NULL should be passed if myVar is undefined. However,
you might want to change that to
null="#!isDefined('myVar') OR !ListLen('myVar')#"
which will also send a null if myVar is defined but empty. Then you can change
the value attribute to
value="#myVar#"
HTH,
Carl
> Hey Ric, let me just add a little bit of what I've experienced in the
> cfqueryparam list. I've actually recently used them in our sites
> extensively now in many different forms (Ref: http://www.houseoffusion.
> com/groups/cf-talk/thread.cfm/threadid:30658)
>
> If a list comes up as '' then sometimes if you have the sql type as
> integer it errors out and I've had to just leave the sql type
> attribute out of the cfqueryparam.
>
> So this,
> <cfqueryparam value="#isDefined('myVar')?myVar:''#"
> null="#!isDefined('myVar')#" list="Yes" cfsqltype="cf_sql_integer" />
>
> ends up going to this,
>
> <cfqueryparam value="#isDefined('myVar')?myVar:''#"
> null="#!isDefined('myVar')#" list="Yes" />
>
> I think it's because if there's no value or it's undefined then it
> can't/doesn't know it's an integer or not, so it defaults to nothing?
> Not sure why really I just know if I don't pass at least a '0' it
> craps out.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:336195
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm