COMMENT
COMMENT#
Syntax#
comment_on ::=#
Prerequisites#
Only the SYS user, the owner of the schema to which the table (or view) belongs, users having the ALTER object privilege for the table (or view), and users having the ALTER ANY TABLE system privilege can use the COMMENT statement to write comments.
Description#
This statement is used to write or modify comments for a specified table, view or column.
user_name#
This is the name of the owner of the object on which the COMMENT statement is executed. If it is omitted, Altibase will assume that the object being commented on belongs to the schema of the user connected via the current session.
table_name, view_name#
This is used to specify the name of the table or view being commented on.
column_name#
This is used to specify the name of the column being commented on.
comment#
This is the actual content of the comment. The comment can be up to 4000 bytes long. To delete an existing comment, execute the COMMENT statement with nothing between the single quotation marks ('').
Example#
<Query> Add comments to the books table, which is owned by the user library1, and to one of its columns.
iSQL> COMMENT ON TABLE library1.books IS 'Table of Book Info';
Comment Created.
iSQL> COMMENT ON COLUMN library1.books.title IS 'Title of Book';
Comment Created.
<Query> Read the table books of the user library 1 and comments for that column.
iSQL> SET VERTICAL ON;
iSQL> SELECT * FROM system_.sys_comments_ WHERE user_name = 'LIBRARY1' AND table_name = 'BOOKS';
SYS_COMMENTS_.USER_NAME : LIBRARY1
SYS_COMMENTS_.TABLE_NAME : BOOKS
SYS_COMMENTS_.COLUMN_NAME : TITLE
SYS_COMMENTS_.COMMENTS : title of book
SYS_COMMENTS_.USER_NAME : LIBRARY1
SYS_COMMENTS_.TABLE_NAME : BOOKS
SYS_COMMENTS_.COLUMN_NAME :
SYS_COMMENTS_.COMMENTS : table of book info
2 rows selected.
<Query> Delete the comments from the books table and the title column in that table.
iSQL> COMMENT ON TABLE library1.books IS '';
Comment created.
iSQL> COMMENT ON COLUMN library1.books.title IS '';
Comment created.