Showing posts with label How to add comments on a table or a column.. Show all posts
Showing posts with label How to add comments on a table or a column.. Show all posts

Thursday, 21 April 2011

How to add comments on a table or a column.


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'