COMMENT
Purpose
Use this statement to add comments about database objects.
Prerequisites
Prerequisites for commenting about an object are as follows:
| Object Type | Prerequisites |
|---|---|
| Schema | Owner or role DBA |
| Table or column | Owner or role DBA, ALTER object privilege on the table or ALTER ANY TABLE |
| Function | Owner or role DBA |
| Script | Owner or role DBA |
| User | Role DBA, system privilege ALTER USER or system privilege CREATE USER |
| Role | Role DBA or system privilege CREATE ROLE |
| Connection | Role DBA or system privilege CREATE CONNECTION |
| Consumer group | Role DBA or system privilege MANAGE CONSUMER GROUPS |
Syntax
comment_table::=
comment_object::=
Usage Notes
- Using the corresponding metadata system tables (for example, EXA_ALL_OBJECTS, EXA_ALL_TABLES) and the command DESC[RIBE] (with
FULLoption), comments can be displayed. - Comments can be dropped by assigning
NULLor the empty string. - Comments can also be defined in the CREATE TABLE statement.
- View comments can only be specified in the CREATE VIEW statement.
- Comments are limited to a maximum length of 2000 characters.
Example
COMMENT ON SCHEMA s1 IS 'My first schema';
COMMENT ON TABLE t1 IS 'My first table';
COMMENT ON t1 (id IS 'Identity column', zip IS 'Zip code');
COMMENT ON SCRIPT script1 IS 'My first script';