The columns of a query are accessible as queryname.columnlist. You can then do
<cfoutput>#queryName[someCol][rownum]#</cfoutput> ======================================================================== === Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc (www.mindseye.com) Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia) Email : [EMAIL PROTECTED] Blog : www.camdenfamily.com/morpheus/blog Yahoo IM : morpheus "My ally is the Force, and a powerful ally it is." - Yoda > -----Original Message----- > From: DeShazo, Jonathan P. (Keane) [mailto:[EMAIL PROTECTED] > Sent: Wednesday, July 16, 2003 11:19 AM > To: CF-Talk > Subject: RE: dynamic query question > > > Why not alias the column name? > As in: > > <CFQUERY NAME="cc" DATASOURCE="#request.mainDSN#"> > SELECT #form.material# AS material, > FROM cc, compat > where chemicalID = #chemicalID# > </CFQUERY> > > -Then refernce the output as cc.material. > > > > -----Original Message----- > From: Emmet McGovern [mailto:[EMAIL PROTECTED] > Sent: Wednesday, July 16, 2003 12:56 PM > To: CF-Talk > Subject: RE: dynamic query question > > > Or better explanation. How do I set the #form.material# so I > can access it as a query variable? > > Emmet > > -----Original Message----- > From: Emmet McGovern > Sent: Wednesday, July 16, 2003 12:42 PM > To: CF-Talk > Subject: dynamic query question > > I was handed a poorly designed to integrate into an app. The > record set is fairly huge. > > I need to access the db using a dynamic query where the > select column statement is populated by a form. > > <CFQUERY NAME="cc" DATASOURCE="#request.mainDSN#"> > SELECT #form.material#, > FROM cc, compat > where chemicalID = #chemicalID# > </CFQUERY> > > My question is how do I reference the column name for output > if I don't know the column name on the processing page? I > know ive seen something about this somewhere. > > Emmet > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. http://www.cfhosting.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

