While it's not the best way to pull data ... how about doing a "select *" in
your query?  You get all the fields back and you can use
queryname.columnlist to see what columns are available.  This gives you a
list and you can then process the query results however you want.

If that doesn't work, 2 should be answered by the recordcount from your
query in 1.  And 4 would required building a dynamic query:

<cfquery ...>
select  #valuelist(nameQuery.name)#
from            table
where           ...
</cfquery>

Is that what you are looking for??

Dan

-----Original Message-----
From: Gilbert Midonnet [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 20, 2002 11:58 AM
To: CF-Talk
Subject: working with SQL meta data


PROBLEM:

1. I am continually inserting fields into a table (2-3/mth).
2. I would like my script to know how many fields exist; and
3. to be able to list them and 
4. pull data from them.



<!--- 1. --->  

I got part one (which I thought was going to be the hard part) and I'm able
to list them (3.)

<cfquery>

select name from syscolumns where upper(name) like '...' and id =
object_id('...')

</cfquery>

So far so good.


<!--- 2. --->

I'm stumped on 2 -- which I thought was going to be the easy part.


I thought I could put the result into a list and work off the list.

<cfset tmp = Evaluate("name")>

#ListLen(tmp)#


No go. :-)


<!--- 3 --->

<cfoutput>#name#</cfoutput> works nicely


<!--- 4 --->

haven't gotten to yet


thx for any clues


// gilbert midonnet







______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to