Available in versions: Dev (3.19) | Latest (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

-- ACCESS, ASE, AURORA_MYSQL, COCKROACHDB, DERBY, DUCKDB, EXASOL, HANA, INFORMIX, MARIADB, MEMSQL, MYSQL, REDSHIFT, 
-- SQLDATAWAREHOUSE, SQLITE, SYBASE
/* UNSUPPORTED */

(These are currently generated with jOOQ 3.19, 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