At 10:11 -0700 6/9/03, Karen Chu wrote:
Thanks for the reply!
Please see my pseudo code below. @@@ mark is the place where my
questions come from. I wonder if it is doable in MySQL.

I'm not sure why you wonder that. You've received several replies so far that indicate you cannot use SELECT for this purpose, and that you should use SHOW or DESCRIBE instead.

Several people also have asked if there is some reason you cannot
use SHOW/DESCRIBE, and you don't appear to have answered that question.
Is there some reason?


I wish to have code like this: (@@@ is where my questions come from) // connect to the DB

// list all table names in the dtabase
print "<tr><td bgcolor=#1A4D80 align=center>$table
Table</font></td></tr>";

//@@@@
$query_all_tables = "select name from all_tables ='$table'";
$result_table_names = mysql_query($query_all_tables) or die("no tables
were ever defined\n");
$row_table_name = mysql_fetch_array($result_table_names);
$table_in_db = $row_table_name["Tables in the DB"];
...
// once a table is selected, let's try to get all fields information in
this table
//@@@
$query_all_fields - "select column_name from all_columns where
table_name ='$selected_table'";
$result_field_names = mysql_quert($query_all_fields) or die("no
fields?\n");
$row_field_name = mysql_fetch_array($result_field_names);
$field_in_table = $row_field_name["Fields in the Table"];






 -----Original Message-----
 From: Mark Matthews [mailto:[EMAIL PROTECTED]
 Sent: Monday, June 09, 2003 8:20 AM
 To: Karen Chu
 Cc: 'gerald_clark'; [EMAIL PROTECTED]
 Subject: Re: How to get meta data info in MySQL

 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1

Karen Chu wrote:

> I wish to have something like 'select name from all_tables' in
oracle or
 > 'select name from sysobjects' in Sybase. Oracle has 'show tables' or
 > 'describe <table>' too, but actual meta data is *stored* in systems
 > tables. I wonder if MySQL also stores these in system tables or
files or
> somewhere else.

MySQL does not currently store this information in system tables.
'SHOW'
 / 'DESCRIBE' are treated as queries by MySQL (just a special case of a
 query), so I'm still confused as why they won't work for you. Is there
a
reason that you _have_ to use system tables for this functionality?

-Mark

 - --
 For technical support contracts, visit
https://order.mysql.com/?ref=mmma

__ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Mark Matthews <[EMAIL PROTECTED]> / /|_/ / // /\ \/ /_/ / /__ MySQL AB, SW Dev. Manager - J2EE/Windows /_/ /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA <___/ www.mysql.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iD8DBQE+5KWHtvXNTca6JD8RAoI2AKDJoYzsvK2UEnA98ttB7wCm6GxOcwCgot7g
 IN4IyjvSI6aApNvx9tEYvHE=
 =VPrD
 -----END PGP SIGNATURE-----


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]


--
Paul DuBois, Senior Technical Writer
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

Are you MySQL certified? http://www.mysql.com/certification/


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to