Available in versions: Dev (3.20) | Latest (3.19) | 3.18 | 3.17 | 3.16 | 3.15 | 3.14 | 3.13 | 3.12 | 3.11

This documentation is for the unreleased development version of jOOQ. Click on the above version links to get this documentation for a supported version of jOOQ.

ALTER VIEW .. COMMENT

Applies to ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

This statement allows for changing the comment associated with a view. It is an alias for the COMMENT ON VIEW statement

Dialect support

This example using jOOQ:

alterView("v").comment("new comment")

Translates to the following dialect specific expressions:

Aurora Postgres, Firebird, Postgres, Teradata, Trino, Vertica, YugabyteDB

COMMENT ON VIEW v IS 'new comment'

BigQuery

ALTER VIEW v SET OPTIONS (DESCRIPTION = 'new comment')

DB2, H2, HSQLDB, Oracle

COMMENT ON TABLE v IS 'new comment'

Snowflake

ALTER VIEW v SET COMMENT = 'new comment'

SQLServer

BEGIN TRY
  DECLARE @u varchar(max) = schema_name();
  EXEC sp_addextendedproperty 'MS_Description', 'new comment', 'schema', @u, 'view', 'v', DEFAULT, DEFAULT
END TRY
BEGIN CATCH
  EXEC sp_updateextendedproperty 'MS_Description', 'new comment', 'schema', @u, 'view', 'v', DEFAULT, DEFAULT
END CATCH

ASE, Access, Aurora MySQL, CockroachDB, Derby, DuckDB, Exasol, Hana, Informix, MariaDB, MemSQL, MySQL, Redshift, SQLDataWarehouse, SQLite, Sybase

/* UNSUPPORTED */

(These are currently generated with jOOQ 3.20, see #10141), or translate your own on our website

Feedback

Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo