db_ddl_comment script
The db_ddl_comment script dumps out the SQL DDL statement that was used to add a comment to an object, that is, the COMMENT ON statement.
The db_ddl_comment command is part of the Db2 support tools. To run it, a database name is required following -d | -db. By default, COMMENT ON statements are produced for all objects (and columns of these objects) for which user-defined comments were added. You can also use -schema or -tb to specify schema or table name to further narrow down the outputs.
Syntax
db_ddl_comment -d|-db <database_name> [-schema <schema_name>] [-tb <table_name>]
Parameters
- -db database_name
-
Specifies a database name. This parameter is required.
- -schema schema_name
-
Specifies a schema name. If you specify a schema name, the COMMENT ON statements are generated for only these tables that belong to the schema.
- -tb table_name
-
Specifies a table name. If you specify a table name, the COMMENT ON statements for this single table are generated.
Outputs
COMMENT ON statements are sent to standard output.