Saturday, March 29, 2014

Add Comments to Oracle Table

It is a good idea to add comments or descriptions to a table that could be lengthier and more descriptive than the table name. We can retrieve the comments later when needed. This is particularly important for a large project that may involve hundreds of tables.

SQL> comment on table TBL_0321 is 'this is a test';

Comment created.

To retrieve the comments, use the following query.
SQL> select comments from user_tab_comments where table_name='TBL_0321';

this is a test

No comments: