In oracle you can run a tab column query to retrieve field names and corresponding 
field types for a given.


SELECT COLUMN_NAME FROM ALL_TAB_COLUMNS WHERE OWNER ='DB_OWNER' AND TABLE_NAME = 
'TABLE_NAME''

Example of this output would look something like this, depending the columns and data 
type defined for your table.

col1             col2  
last_name     varchar2
first_name      varchar2
brith_date       date

Hope this is what you wanted.



Nick Han

>>> [EMAIL PROTECTED] 03/18/03 10:28AM >>>
There is not a direct way to get Field Data types and length in CFMX/CF. You can use a 
Java Bean to get the meta-data

ResultSet rs = stmt.executeQuery("select f1,f2,...from Table");
ResultSetMetaData rsmd = rs.getMetaData();

"rsmd" has everything you need to know about the ResultSet or Table

Joe Eugene


-------Original Message-------
From: paris lundis <[EMAIL PROTECTED]>
Sent: 03/18/03 01:23 PM
To: CF-Talk <[EMAIL PROTECTED]>
Subject: fetching the field type ?

> 
> Working with any database in CF is easy and most of us know where we can
find the field names of a fetched query - programmatically... 

Does anyone know off hand if it is possible to retrieve or otherwise
determine the field types that match the field names? (ie: text(length),
integer, etc.?)

One of those missing pieces to creating some interesting reusable
widgets..

-paris



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to