I suppose this would work just as well, since recordid is a primary key:

null="#YesNoFormat(not anotherquery.recordcount)#"

I'm still not completely clear on how the null attribute is used.  If 
anotherquery comes back with a recordcount=0, then the cfsqlqueryparam 
attribute value would evaluate to something like:

WHERE recordid IN
(<cfqueryparam
  cfsqltype="cf_sql_varchar"
  value=""
  list="Yes"
  null="Yes">)

Does this become the following in SQL, so that having null="Yes" just 
overrides the value parameter?

WHERE recordid IN (NULL)




----- Original Message ----- 
From: "Aaron Rouse" <[EMAIL PROTECTED]>
To: "CF-Talk" <[email protected]>
Sent: Wednesday, March 08, 2006 3:29 PM
Subject: Re: SQL IN and cfqueryparam lists


>I believe that null will work but I'd use the listlen function.  Mine 
>would
> look something like:
>
> Not(YesNoFormat(ListLen(ValueList(AnotherQuery.RecordID))))
>
>
> On 3/8/06, Jim McAtee <[EMAIL PROTECTED]> wrote:
>>
>> Is it necessary to designate list="yes" for a cfsqlqueryparam value if 
>> the
>> value is already a comma delimitted list?  Or is that exactly what the
>> attibute is to be used for?
>>
>> Is the following a valid use of the 'null' attribute?
>>
>> WHERE recordid IN
>> (<cfqueryparam
>>   cfsqltype="cf_sql_varchar"
>>   value="#ValueList(anotherquery.recordid)#"
>>   list="Yes"
>>   null="#YesNoFormat(not Len(ValueList(anotherquery.recordid)))#">)
>>
>>
>>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234755
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