It does, but it still looks like it's a little more clunky (in my opinion at 
least :)) than the tag-based alternative. Bummer, since I much prefer the 
succinct style of CFSCRIPT for writing pretty much everything else in a 
component.

Thanks for your help everyone!

>var q = new com.adobe.coldfusion.query();
>q.setDatasource("cfartgallery");
>var sql = "select mediatype from media";
>if(structKeyExists(arguments, "something")) {
> sql &= " where media like :search";
> q.addParam(name="search",value="%#arguments.str#%",cfsqltype="cf_sql_varchar");
>}
>q.setSQL(sql);
>var results = q.execute().getResult();
>
>Does that make sense?
>
>> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344006
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to