in reply to DBI recipes

++ Very useful node, thanks gmax.

For the sake of portability it might also be useful to note that ANSI SQL-92 provides a standard for querying table schema information:

select TABLE_NAME from INFORMATION_SCHEMA.TABLES

And to give an idea of what else is available via INFORMATION_SCHEMA;
SCHEMATA DOMAINS VIEWS COLUMNS TABLE_PRIVILEGES COLUMN_PRIVILEGES USAGE_PRIVILEGES DOMAIN_CONSTRAINTS TABLE_CONSTRAINTS REFERENTIAL_CONSTRAINTS CHECK_CONSTRAINTS KEY_COLUMN_USAGE ASSERTIONS VIEW_TABLE_USAGE VIEW_COLUMN_USAGE CONSTRAINT_TABLE_USAGE CONSTRAINT_COLUMN_USAGE CONSTRAINT_DOMAIN_USAGE
Source: An Introduction to Database Systems (7th edition), C.J. Date


Comment on Re: DBI recipes
Select or Download Code
Re: Re: DBI recipes
by dragonchild (Archbishop) on Feb 16, 2004 at 21:40 UTC
    I'd like to point out that while most databases are mostly SQL-92 compliant, INFORMATION_SCHEMA.TABLES is not implemented in Oracle 9.2.0.4 (the latest patch release, that I'm aware of).

    I don't know if any other database implements this or not.

    ------
    We are the carpenters and bricklayers of the Information Age.

    Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

      It's a fair point you make. Both Oracle and Microsoft continue to stretch the meaning of compliance.

      It is almost meaningless now but at this rate by 2020 it could simply mean that the product engineers know how to spell I-S-O.