12. Managing Tables and Views : Synonyms, Temporary Tables, and Comments : Comments to Describe Tables and Views : The COMMENT ON Statement
 
Share this page                  
The COMMENT ON Statement
The COMMENT ON statement lets you add commentary to SQL programs. Using this statement, you can create a comment for the table, view, and for individual columns in the table.
For example, to add a remark on the name column and on the status column of the employee table:
COMMENT ON employee IS
  'This is the ALL Employees table including managers and their direct reports';
COMMENT ON COLUMN employee.status IS
  'valid codes are:
     01, exempt; 02, non-exempt; 03, temp';
To show a comment, use the HELP COMMENT statement. For example, the comment on the status column can be show by the statement:
HELP COMMENT COLUMN employee status;
To delete a comment, specify an empty string. For example, the comment on the status column can be deleted by the statement:
COMMENT ON COLUMN employee.status IS '';
For complete details, see the COMMENT ON statement in the SQL Language Guide.