Wednesday, November 19, 2008

How to add comments on a table or a column.

If we want to give a comment on a table :

COMMENT ON TABLE
IS 'the comments should go here';

If we want to give a comment on a column :

COMMENT ON TABLE | COLUMN table.column
IS 'the comments should go here';

The entries of these comments on the table goes in the following tables:

For tables:
select * from all_tab_comments
where table_name ='table_name'

select * from user_tab_comments
where table_name = 'table_name'

For Columns:
select * from all_col_comments
where table_name = 'table_name'

select * from user_col_comments
where table_name = 'table_name'

No comments: