In DB2, you can view a table’s comments using the following methods:
- DESCRIBE command:
DESC TABLE
;
- This will display detailed information about the table, including comments.
- Use the SYSIBM.SYSTABLES system table to retrieve the REMARKS column where the CREATOR is ‘‘ and the NAME is ‘‘;
- This will return the comments of the specified table.
- Use the SYSIBM.SYSCOLUMNS system table to:
Retrieve the REMARKS
From SYSIBM.SYSCOLUMNS
Where TBNAME=’
‘
And TBCREATOR=’
‘;
- This will return the comments for each column in the specified table.
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.
✖