Getting table and field names
janschenkel at yahoo.com
Mon Aug 6 13:03:16 CDT 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.
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
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,
Quartam Reports & PDF Library for Revolution
"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.
More information about the use-livecode