How to view table comments in db2?

In DB2, you can view a table’s comments using the following methods:

  1. DESCRIBE command:

    DESC TABLE

    ;
  2. This will display detailed information about the table, including comments.
  3. Use the SYSIBM.SYSTABLES system table to retrieve the REMARKS column where the CREATOR is ‘‘ and the NAME is ‘‘;
  4. This will return the comments of the specified table.
  5. Use the SYSIBM.SYSCOLUMNS system table to:
    Retrieve the REMARKS
    From SYSIBM.SYSCOLUMNS
    Where TBNAME=’


  6. And TBCREATOR=’

    ‘;
  7. This will return the comments for each column in the specified table.
  8. Please note, in the above query, replace

    with the name of the table you want to view, and

    with the schema name of the table.

    Leave a Reply 0

    Your email address will not be published. Required fields are marked *


    广告
    Closing in 10 seconds