On 9/17/07, Vince Collins <[EMAIL PROTECTED]> wrote:
>
>
> That suggestion works.  However, in an example of a query with 10
> columns and assuming you want to allow desc and asc, does anyone  have a
> more conscience way other than 20 cfcase statements?


You could specify a list of table names and use ListFindNoCase(). Or you
could come up with an automatic solution by using JDBC metadata (or if/when
you switch the CF8, the CFDBINFO tag) to get the valid column names for the
table and compare the incoming order by value to those. You'd probably want
to do this once per table and cache the column names somewhere so you
wouldn't have to do it on every request.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Enterprise web applications, build robust, secure 
scalable apps today - Try it now ColdFusion Today
ColdFusion 8 beta - Build next generation apps

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288644
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to