I do exactly this except with Sybase - it works great.

On Wed, 20 Oct 2004 21:19:46 +0800, James Holmes
<[EMAIL PROTECTED]> wrote:
> This will give you just the tables:
> 
> select  tabs.table_name
> from sys.user_All_tables tabs
> 
> and this will give you more than you want to know about a table, if you
> replace :TABNAME with the name of your table:
> 
> Select cols.column_id, cols.column_name as Name, nullable,
>  data_type as Type,
>  decode(data_type, 'CHAR', char_length,
>                    'VARCHAR', char_length,
>                    'VARCHAR2', char_length,
>                    'NCHAR', char_length,
>                    'NVARCHAR', char_length,
>                    'NVARCHAR2', char_length,
>                    null) nchar_length,
>  Decode( data_type, 'NUMBER', data_precision + data_scale, data_length )
> Length,
>  data_precision Precision, data_scale Scale, data_length dlength,
> data_default
> , ' ' comments
> , DATA_TYPE_MOD
>  FROM
>  sys.user_tab_columns cols
>  where
>  cols.table_name = :TABNAME
>  order by column_id
> 
> -----Original Message-----
> From: Daniel Kessler [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, 20 October 2004 9:03
> To: CF-Talk
> Subject: reports
> 
> I'm looking to do some on-the-fly reports for our Oracle database tables.
> To begin, I have two questions.
> 
> 1 - I can query for a list of tables by doing "select * from cat", though I
> picked up this code and don't know what cat stands for.  Is there a way to
> eliminate Sequences from the list of tables it returns either during the
> query or at the time that I make my drop-down in CF?
> I also tried "SELECT TABLE_NAME FROM ALL_TABLES" but that returns even more
> tables though I'm not sure why.
> 
> 2 - Once I retrieve a list of field names, is there a way to check the type
> of each one?
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF 
community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=37

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:181998
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to