Getting table and field names

Jan Schenkel janschenkel at yahoo.com
Mon Aug 6 14:03:16 EDT 2007


--- Mikey <mikeythek at gmail.com> wrote:
> I'm looking all over but I can't find SQL commands
> to use with ODBC to
> extract the table names for a database, and once I
> have those to
> extract the column names for a table.  My SQL is
> pretty darn rusty, in
> case you couldn't figure that out already.
> 
> TIA.
> 

Hi Mikey,

Unfortunately, the Revolution database layer does not
provide direct access to the database schema at the
moment. Depending on the database, you can script
these yourself, though.

Here's the query for MS Access:
SELECT name FROM MSysObjects WHERE type IN (1,6) AND
name NOT LIKE 'MSys%';
And here's the query for PostgreSQL:
SELECT tablename FROM pg_tables WHERE tablename NOT
LIKE 'pg%';

The problem is, of course, that you have to get the
right query for every database separately.
Also, the user must have the necessary privileges to
extract this schema information.

Hope this helped,

Jan Schenkel.

Quartam Reports & PDF Library for Revolution
<http://www.quartam.com>

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)


       
____________________________________________________________________________________
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. 
http://mobile.yahoo.com/go?refer=1GNXIC



More information about the use-livecode mailing list