The COMMENT statement adds or replaces comments in the catalog descriptions of various objects.
This statement can be embedded in an application program or issued through the use of dynamic SQL statements. It is an executable statement that can be dynamically prepared only if DYNAMICRULES run behavior is in effect for the package (SQLSTATE 42509).
Note that for table space or database partition group, and bufferpools, the authorization ID must have SYSCTRL or SYSADM authority.
>>-COMMENT ON---------------------------------------------------> >--+-| objects |--IS--string-constant---------------------------+->< | .-,--------------------------------. | | V | | '-+-table-name-+--(----column-name--IS--string-constant-+--)-' '-view-name--' objects |------+-| alias-designator |--------------------------------------+------| +-AUDIT POLICY--policy-name---------------------------------+ +-COLUMN--+-table-name.column-name-+------------------------+ | '-view-name.column-name--' | +-CONSTRAINT--table-name.constraint-name--------------------+ +-DATABASE PARTITION GROUP--db-partition-group-name---------+ +-| function-designator |-----------------------------------+ +-FUNCTION MAPPING--function-mapping-name-------------------+ +-HISTOGRAM TEMPLATE--template-name-------------------------+ | (1) | +-INDEX--index-name-----------------------------------------+ +-MODULE--module-name---------------------------------------+ +-NICKNAME--nickname----------------------------------------+ +-PACKAGE--package-name--+-------------------------+--------+ | | .-VERSION-. | | | '-+---------+--version-id-' | +-| procedure-designator |----------------------------------+ +-ROLE--role-name-------------------------------------------+ +-SCHEMA--schema-name---------------------------------------+ +-SECURITY LABEL--sec-label-name----------------------------+ +-SECURITY LABEL COMPONENT--label-comp-name-----------------+ +-SECURITY POLICY--label-pol-name---------------------------+ +-SEQUENCE--sequence-name-----------------------------------+ +-SERVER--server-name---------------------------------------+ +-SERVER OPTION--server-option-name--FOR--| remote-server |-+ +-| service-class-designator |------------------------------+ +-TABLE--+-table-name-+-------------------------------------+ | '-view-name--' | +-TABLESPACE--tablespace-name-------------------------------+ +-THRESHOLD--threshold-name---------------------------------+ +-TRIGGER--trigger-name-------------------------------------+ +-TRUSTED CONTEXT--context-name-----------------------------+ +-TYPE--type-name-------------------------------------------+ +-TYPE MAPPING--type-mapping-name---------------------------+ +-VARIABLE--variable-name-----------------------------------+ +-WORK ACTION SET--work-action-set-name---------------------+ +-WORK CLASS SET--work-class-set-name-----------------------+ +-WORKLOAD--workload-name-----------------------------------+ +-WRAPPER--wrapper-name-------------------------------------+ '-XSROBJECT--xsrobject-name---------------------------------' alias-designator .-FOR TABLE----. |----+--------+--ALIAS--alias-name--+--------------+------------| '-PUBLIC-' +-FOR MODULE---+ '-FOR SEQUENCE-' function-designator |--+-FUNCTION--function-name--+-------------------------+-+-----| | '-(--+---------------+--)-' | | | .-,---------. | | | | V | | | | '---data-type-+-' | '-SPECIFIC FUNCTION--specific-name---------------------' procedure-designator |--+-PROCEDURE--procedure-name--+-------------------------+-+---| | '-(--+---------------+--)-' | | | .-,---------. | | | | V | | | | '---data-type-+-' | '-SPECIFIC PROCEDURE--specific-name----------------------' remote-server |--+-SERVER--server-name------------------------------------------------------------------+--| '-SERVER TYPE--server-type--+--------------------------------------------------------+-' '-VERSION--| server-version |--+-----------------------+-' '-WRAPPER--wrapper-name-' server-version |--+-version--+------------------------+-+----------------------| | '-.--release--+--------+-' | | '-.--mod-' | '-version-string-constant-------------' service-class-designator |----SERVICE CLASS--service-class-name--+--------------------------------+----| '-UNDER--service-superclass-name-'
If PUBLIC is specified, the alias-name must identify a public alias that exists at the current server (SQLSTATE 42704).
If the data-type is unqualified, the type name is resolved by searching the schemas on the SQL path. This also applies to data type names specified for a REFERENCE type.
It is not necessary to specify the length, precision or scale for the parameterized data types. Instead an empty set of parentheses may be coded to indicate that these attributes are to be ignored when looking for a data type match.
FLOAT() cannot be used (SQLSTATE 42601) since the parameter value indicates different data types (REAL or DOUBLE).
However, if length, precision, or scale is coded, the value must exactly match that specified in the CREATE FUNCTION statement.
A type of FLOAT(n) does not need to match the defined value for n since 0 <n<25 means REAL and 24<n<54 means DOUBLE. Matching occurs based on whether the type is REAL or DOUBLE.
(Note that the FOR BIT DATA attribute is not considered part of the signature for matching purposes. So, for example, a CHAR FOR BIT DATA specified in the signature would match a function defined with CHAR only, and vice versa.)
If no function with the specified signature exists in the named or implied schema, an error (SQLSTATE 42883) is raised.
It is not possible to comment on a function that is in the SYSIBM, SYSFUN, or SYSPROC schema (SQLSTATE 42832).
The comment replaces the value of the REMARKS column of the SYSCAT.ROUTINES catalog view for the row that describes the function.
Indicates that a comment will be added or replaced for a package. The package
name must identify a package that exists at the current server (SQLSTATE 42704). The comment
replaces the value for the REMARKS column of the SYSCAT.PACKAGES catalog view for the row that
describes the package. 
If the data-type is unqualified, the type name is resolved by searching the schemas on the SQL path. This also applies to data type names specified for a REFERENCE type.
It is not necessary to specify the length, precision or scale for the parameterized data types. Instead an empty set of parentheses may be coded to indicate that these attributes are to be ignored when looking for a data type match.
FLOAT() cannot be used (SQLSTATE 42601) since the parameter value indicates different data types (REAL or DOUBLE).
However, if length, precision, or scale is coded, the value must exactly match that specified in the CREATE PROCEDURE statement or the local catalog information, in the case of a federated procedure.
A type of FLOAT(n) does not need to match the defined value for n since 0<n<25 means REAL and 24<n<54 means DOUBLE. Matching occurs based on whether the type is REAL or DOUBLE.
If no procedure with the specified signature exists in the named or implied schema, an error (SQLSTATE 42883) is raised.
It is not possible to comment on a procedure that is in the SYSIBM, SYSFUN, or SYSPROC schema (SQLSTATE 42832).
The comment replaces the value of the REMARKS column of the SYSCAT.ROUTINES catalog view for the row that describes the procedure.
In dynamic SQL statements, the CURRENT SCHEMA special register is used as a qualifier for an unqualified object name. In static SQL statements the QUALIFIER precompile/bind option implicitly specifies the qualifier for unqualified object names.
A comment cannot be made on a column of an inoperative view (SQLSTATE 51024).
COMMENT ON TABLE EMPLOYEE
IS 'Reflects first quarter reorganization'
COMMENT ON TABLE EMP_VIEW1
IS 'View of the EMPLOYEE table without salary information'
COMMENT ON COLUMN EMPLOYEE.EDLEVEL
IS 'highest grade level passed in school'
COMMENT ON EMPLOYEE
(WORKDEPT IS 'see DEPARTMENT table for names',
EDLEVEL IS 'highest grade level passed in school' )
COMMENT ON FUNCTION CENTRE (INT,FLOAT)
IS 'Frank''s CENTRE fctn, uses Chebychev method'
COMMENT ON SPECIFIC FUNCTION PELLOW.FOCUS92 IS
'Louise''s most triumphant CENTRE function, uses the
Brownian fuzzy-focus technique'
COMMENT ON FUNCTION CHEM.ATOMIC_WEIGHT
IS 'takes atomic nbr, gives atomic weight'
COMMENT ON PROCEDURE SEARCH (CHAR,INT)
IS 'Frank''s mass search and replace algorithm'
COMMENT ON SPECIFIC PROCEDURE EIGLER.DESTROY IS
'Patrick''s mass search and destroy algorithm'
COMMENT ON PROCEDURE BIOLOGY.OSMOSIS
IS 'Calculations modelling osmosis'
COMMENT ON INDEX INDEXSPEC
IS 'An index specification that indicates to the optimizer
that the table referenced by nickname NICK1 has an index.'
COMMENT ON WRAPPER NET8
IS 'The wrapper for data sources associated with
Oracle's Net8 client software.'
COMMENT ON XSROBJECT HR.EMPLOYEE
IS 'This is the base XML Schema for employee data.'
COMMENT ON TRUSTED CONTEXT APPSERVER
IS 'WebSphere Server'