1COMMENT ON TABLE table_name IS 'A table comment';
2COMMENT ON COLUMN table_name.MY_COLUMN IS 'A column comment';
3
4SELECT * FROM ALL_TAB_COMMENTS WHERE TABLE_NAME = 'TABLE_NAME';
5SELECT * FROM ALL_COL_COMMENTS WHERE TABLE_NAME = 'TABLE_NAME';
1COMMENT ON COLUMN TABLE_NAME.MY_COLUMN IS 'A column comment';
2SELECT * FROM ALL_COL_COMMENTS WHERE TABLE_NAME = 'TABLE_NAME';
3-- All schema columns:
4SELECT t.OWNER, t.TABLE_NAME, c.COLUMN_NAME, com.COMMENTS
5FROM DBA_TABLES t LEFT JOIN DBA_TAB_COLUMNS c
6 ON c.OWNER = t.OWNER AND c.TABLE_NAME = t.TABLE_NAME
7LEFT JOIN DBA_COL_COMMENTS com ON com.OWNER = c.OWNER AND com.TABLE_NAME = c.TABLE_NAME
8 AND com.COLUMN_NAME = c.COLUMN_NAME
9WHERE t.OWNER = 'MY_OWNER' AND t.DROPPED = 'NO'
10ORDER BY t.OWNER, t.TABLE_NAME, c.COLUMN_NAME;
1SELECT * FROM ALL_TAB_COMMENTS WHERE TABLE_NAME = 'MY_TABLE'; -- Table comment
2SELECT * FROM ALL_COL_COMMENTS WHERE TABLE_NAME = 'MY_TABLE'; -- Columns comments
3
4-- All owner tables:
5SELECT t.OWNER, t.TABLE_NAME, com.COMMENTS
6FROM DBA_TABLES t
7LEFT JOIN DBA_TAB_COMMENTS com ON com.OWNER = t.OWNER AND com.TABLE_NAME = t.TABLE_NAME
8WHERE t.OWNER = 'TRANSFERT_DOAAT' AND t.DROPPED = 'NO'
9ORDER BY t.OWNER, t.TABLE_NAME;