Use the COMMENT ON command to add a description to a database, table, view, or column.
Options
colname
Adds a description for a column in all tables in which it appears.
DATABASE
Adds a description for the connected database.
DELETE
Removes a description for a table or for a column in either the specified table or in all tables.
IN tblname
Adds a description for a column only in the specified table.
IS 'description'
Defines a description for a table or for a column in either the specified table or in all tables. The description is limited to 128 characters. The text must be enclosed in quotes using the current QUOTES setting.
TABLE tblname
Adds a description for the specified table.
VIEW viewname
Adds a description for the specified view.
tblname.colname
Specifies a column name. In a command, you can enter #c, where #c is the column number shown when the columns are listed with the LIST TABLES command. In an SQL command, a column name can be preceded by a table or correlation name and a period (tblname.colname).
About the COMMENT ON Command
Descriptions must be enclosed in single quotation marks ('), or the current delimiter character for QUOTES.
When you add a description to a column that appears in multiple tables, R:BASE adds the description to the column in every table. If you add a new table containing the column, you must add the description for that column to the new table.
Use the LIST command to list the descriptions of the tables and columns. R:BASE also displays the description when you modify a table using the Data Designer.
The database comment is displayed in the output of the LIST comment with the number of tables, columns, indexes, etc. The (CVAL('DBCOMMENT')) function can be used to retrieve the comment.
Comments are stored in the SYS_COMMENTS system table. When a column or table is renamed or removed, R:BASE automatically updates the SYS_COMMENTS table to reflect the change.
When access rights for a table have been assigned using the GRANT command, COMMENT ON requires the database owner's user identifier to describe tables and columns.
Examples
The following command adds a description to the Employee table.
COMMENT ON TABLE Employee IS 'Employee Information'
The following command adds a description to the EmpID column in all tables in the database.
COMMENT ON EmpID IS 'Employee Identification Number'
The following commands show two ways to add a description to the EmpID column in only the Employee table.
COMMENT ON Employee.EmpID IS 'Employee Identification Number'
COMMENT ON EmpID IN Employee IS 'Employee Identification Number'
The following command removes the description from the Employee table.
COMMENT ON TABLE Employee DELETE
The following command removes the description from the EmpID column in every table in which the column occurs.
COMMENT ON EmpID DELETE
The following command removes the description from the EmpID column in the Employee table.
COMMENT ON EmpID IN Employee DELETE
The following command adds a description to the UserManagement database.
COMMENT ON DATABASE IS 'User and Contact Management System'