Answers for "table level comment in oracle"

SQL
5

oracle create table comment

COMMENT ON TABLE table_name IS 'A table comment';
COMMENT ON COLUMN table_name.MY_COLUMN IS 'A column comment';

SELECT * FROM ALL_TAB_COMMENTS WHERE TABLE_NAME = 'TABLE_NAME';
SELECT * FROM ALL_COL_COMMENTS WHERE TABLE_NAME = 'TABLE_NAME';
Posted by: Guest on June-15-2021
1

oracle column comment

COMMENT ON COLUMN TABLE_NAME.MY_COLUMN IS 'A column comment';
SELECT * FROM ALL_COL_COMMENTS WHERE TABLE_NAME = 'TABLE_NAME';
-- All schema columns:
SELECT t.OWNER, t.TABLE_NAME, c.COLUMN_NAME, com.COMMENTS
FROM DBA_TABLES t LEFT JOIN DBA_TAB_COLUMNS c
    ON c.OWNER = t.OWNER AND c.TABLE_NAME = t.TABLE_NAME
LEFT JOIN DBA_COL_COMMENTS com ON com.OWNER = c.OWNER AND com.TABLE_NAME = c.TABLE_NAME
    AND com.COLUMN_NAME = c.COLUMN_NAME
WHERE t.OWNER = 'MY_OWNER' AND t.DROPPED = 'NO'
ORDER BY t.OWNER, t.TABLE_NAME, c.COLUMN_NAME;
Posted by: Guest on June-15-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language