List tables in Db2 database

Marcin Nagly - Dataedo Team Marcin Nagly 2019-04-01

Table of Contents:


    Query below lists all tables in IBM Db2 database. (only table type)

    Query

    select tab.tabschema as schema_name,
        tab.tabname as table_name,
        tab.create_time,
        tab.alter_time
    from syscat.tables tab
    where tab.type = 'T'
        and tab.tabschema not like 'SYS%'
    order by tab.tabschema, tab.tabname 
    

    Columns

    • schema_name - schema name
    • table_name - table name
    • create_time - date the table was created
    • alter_time - date the table was last modified by using an ALTER statement

    Rows

    • One row represents one table in the database
    • Scope of rows: all tables in the database
    • Ordered by schema and name

    Sample results

    You could also get this

    Get this interactive HTML data dictionary in minutes with Dataedo.

    See live HTML data dictionary sample

    Try for free

    0
    There are no comments. Click here to write the first comment.

    By continuing to use our website, you consent to the use of cookies in accordance with our Privacy Policy (updated 28-04-2020).
    Accept