db2ibm-clouddb2-luwdashdb

SQL to list tables in a dashDB schema


I need to list all of the tables in a schema in dashDB (Db2 Warehouse on Cloud on IBM Cloud).

Is this possible using just a SQL statement or do I need a CLI tool for this?

If it is possible using a SQL statement, please let me know what it is.

Please DON'T provide the CLI statement.


Solution

  • The following should do:

    select tabname from syscat.tables
    where tabschema='yourSpecificSchemaName'
    

    Note that information like the above can be found in the Knowledge Center for dashDB in the roadmap to catalog views. The view used above is SYSCAT.TABLES.