I have a web page that displays a list of SQL databases in a select box.  The
user selects a database and a table, and is taken to a page where the
information is displayed from the database.  At least, that's what I want to do.
I can't figure out how to get the list of columns to be displayed in a table.  I
have a query that picks out the columns from the database table:

<cfquery name="getColumns" DBTYPE="OLEDB" DBNAME="#url.databases#"
PROVIDER="SQLOLEDB" DATASOURCE="mysource">
SELECT * from information_schema.columns where table_name = '#url.table#'
</cfquery>

And a query that gets the data from that table:

<cfquery name="getData" DBTYPE="OLEDB" DBNAME="#url.databases#"
PROVIDER="SQLOLEDB" DATASOURCE="mysource">
Select * from #url.table#
</cfquery>

but I don't know how I can display it, given the fact that the column names are
variables.  I tried the following:

<cfloop query="getData"><cfoutput
query="getColumns">#column_name#</cfoutput><br></cfloop>

but that just gives me the name of the column repeated for the number of
records.

Any ideas?

tom

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to