Oracle - Commenting

oracle

How to add a comment for a table, view, snapshot, or column?

COMMENT ON TABLE schemaName.[tableName | viewName | snapshotName] IS 'blah blah blah';
COMMENT ON TABLE schemaName.[tableName | viewName | snapshotName].columnName IS 'blah blah blah';
COMMENT ON COLUMN shipping.notes IS 'blah blah blah;

How to remove a comment?

Set it to an empty string:

COMMENT ON COLUMN shipping.notes IS '';

How to view the comments on a particular table or column?

SELECT * FROM ALL_TAB_COMMENTS;
SELECT * FROM ALL_COL_COMMENTS;
SELECT * FROM USER_TAB_COMMENTS;
SELECT * FROM DBA_TAB_COMMENTS;
SELECT * FROM USER_COL_COMMENTS;
SELECT * FROM DBA_COL_COMMENTS;
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License