House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

Get Database Tables, etc

  << Previous Post |  RSS |  Tree View |  Sort Oldest First |  Subscribe to this Group Next >> 

Get Database Tables, etc

What database? MSSQL I use sp_tables. Greg Luce 06/05/2004 07:44 AM
Robert Shaw wrote: Jochem van Dieten 06/04/2004 04:39 PM
This is DB2 on MX... Robert Shaw 06/04/2004 01:06 PM
In MS SQL Server (2000), you can use the system stored procedure sp_tables. Shawn Grover 06/04/2004 01:00 PM
I'm using Oracle 9i: Semrau Steven Ctr SAF/IE 06/04/2004 12:23 PM
you could use mavinson 06/04/2004 12:12 PM
Robert Shaw wrote: Jochem van Dieten 06/04/2004 11:58 AM
Depends on the DB, I know that you can do "show tables" with mySQL Mark Drew 06/04/2004 11:57 AM
>>Does anyone have the code for querying a database and returning a list Claude Schneegans 06/04/2004 11:54 AM
I know I have seen this on the list before but I can't find the exact code. Robert Shaw 06/04/2004 11:50 AM

06/05/2004 07:44 AM
Author: Greg Luce Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32994#165590 What database? MSSQL I use sp_tables. I know I have seen this on the list before but I can't find the exact code. Does anyone have the code for querying a database and returning a list of tables and/or column info? TIA, Robbie
06/04/2004 04:39 PM
Author: Jochem van Dieten Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32994#165569 Robert Shaw wrote: > This is DB2 on MX... DB2 doesn't use the information schema, but the syscat schema: http://www-306.ibm.com/cgi-bin/db2www/data/db2/udb/winos2unix/support/document.d2w/report?fn=db2s003.htm#ToC_557 Jochem
06/04/2004 01:06 PM
Author: Robert Shaw Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32994#165540 This is DB2 on MX... >>Does anyone have the code for querying a database and returning a list of tables and/or column info? Depending on the database you're using, there is some code possible, but not for all databases. For any kind of ODBC database, CFX_ODBCInfon is the sure way. See the address below.
06/04/2004 01:00 PM
Author: Shawn Grover Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32994#165539 In MS SQL Server (2000), you can use the system stored procedure sp_tables. Issuing the command: exec sp_tables will list all the tables in the current database, with a column for table type (System or Table).  More details are in the online help for T-SQL. There are similar stored procs for getting the primary keys, foriegn keys, and lists of databases.  I also know database systems other than MS SQL have similar functions for getting the meta data of a database. HTH Shawn I know I have seen this on the list before but I can't find the exact code. Does anyone have the code for querying a database and returning a list of tables and/or column info? TIA, Robbie   _____  
06/04/2004 12:23 PM
Author: Semrau Steven Ctr SAF/IE Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32994#165532 I'm using Oracle 9i: SELECT object_name FROM    user_objects WHERE object_type in ('TABLE', 'VIEW') This will get you the table and view names. SELECT column_name FROM    user_tab_columns WHERE table_name = 'your_table_name_here' This will get you the columns for that particular table. SELECT  DISTINCT table_name, column_name FROM    user_tab_columns ORDER BY 1,2 This will get you the table names with their associated column names. HTH I know I have seen this on the list before but I can't find the exact code. Does anyone have the code for querying a database and returning a list of tables and/or column info? TIA, Robbie   _____  
06/04/2004 12:12 PM
Author: mavinson Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32994#165527 you could use <cfquery name="fetchStuff" datasource="myDsn">         select * from myTable </cfquery> <cfdump var="#fetchStuff#"> -mike "Robert Shaw" <robertshawsjaws@hotmail.com> 06/04/2004 11:47 AM Please respond to cf-talk         To:     CF-Talk <cf-talk@houseoffusion.com>         cc:         Subject:        Get Database Tables, etc I know I have seen this on the list before but I can't find the exact code. Does anyone have the code for querying a database and returning a list of tables and/or column info? TIA, Robbie
06/04/2004 11:58 AM
Author: Jochem van Dieten Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32994#165524 Robert Shaw wrote: > I know I have seen this on the list before but I can't find the exact code. > Does anyone have the code for querying a database and returning a list of > tables and/or column info? If your database is compliant with the SQL spec you can get all off that from the information schema: SELECT * FROM INFORMATION_SCHEMA.TABLES; SELECT * FROM INFORMATION_SCHEMA.COLUMNS; Jochem
06/04/2004 11:57 AM
Author: Mark Drew Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32994#165523 Depends on the DB, I know that you can do "show tables" with mySQL for MS SQL you can do a query to the sysobjects table as follows: SELECT     * FROM         sysobjects WHERE     (xtype = 'U') HTH Mark Drew ----- Excess quoted text cut - see Original Post for more -----
06/04/2004 11:54 AM
Author: Claude Schneegans Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32994#165521 >>Does anyone have the code for querying a database and returning a list of tables and/or column info? Depending on the database you're using, there is some code possible, but not for all databases. For any kind of ODBC database, CFX_ODBCInfon is the sure way. See the address below. -- _______________________________________ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: piegeacon@internetique.com) Thanks.
06/04/2004 11:50 AM
Author: Robert Shaw Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32994#165519 I know I have seen this on the list before but I can't find the exact code. Does anyone have the code for querying a database and returning a list of tables and/or column info? TIA, Robbie
<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 24, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
     1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31     

Designer, Developer and mobile workflow conference