Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Oracle Comment Feature

Status
Not open for further replies.

praful24

Programmer
Feb 27, 2008
4
0
0
What is Oracle Comment Feature?
 
I assume you are referring to the ability to store comments in the data dictionary using the COMMENT command.

comment on table xxxx is 'abcdefg';

The comments can then be viewed in the things like USER_TAB_COMMENTS etc.
 
Praful,

The Oracle Comments feature gives you the option to document, in the data dictionary, information about individual tables and their columns. It provides a tighter relationship between the documentation of objects in your database, than some external form of documentation.

Here is an example of both how to add documentation to an existing table, then to some of its columns, and how to display the comments for those objects:
Code:
SQL> comment on table s_emp is 'This table contains employee information.';
SQL> comment on column s_emp.last_name
     is 'This column records the surname of each employee.';
SQL> comment on column s_emp.salary
     is 'This column records the monthly pay in British Pounds Sterling.';

col comments format a50
select table_name, comments
  from user_tab_comments
 where table_name = 'S_EMP';

TABLE_NAME                     COMMENTS
------------------------------ -----------------------------------------
S_EMP                          This table contains employee information.

select table_name, column_name, comments
from user_col_comments
where table_name = 'S_EMP'
  and comments is not null;

TABLE_NAME COLUMN_NAME COMMENTS
---------- ----------- --------------------------------------------------
S_EMP      LAST_NAME   This column records the surname of each employee.
S_EMP      SALARY      This column records the monthly pay in British Pou
                       nds Sterling.
Notice the two different names of the objects in the data dictionary that store comments for tables and columns:[ul][li]user_tab_comments, and[/li][li]user_col_comments[/li][/ul]Let us know if this is helpful information.


[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
I was composing while Dagon was posting...Sorry. (I wish Tek-Tips had a feature that warned, "Someone has posted to the thread to which you are currently replying.")

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top