Limited support BMC provides limited support for this version of the product. As a result, BMC no longer accepts comments in this space. If you encounter problems with the product version or the space, contact BMC Support.BMC recommends upgrading to the latest version of the product. To see documentation for that version, see ALTER and BMC AMI Change Manager for Db2 13.1.

ALTER VIEW statement


The ALTER VIEW statement defines changes to be made to an existing view definition.

GUID-830B96BF-776E-4921-9A60-40A90258F6E0-low.png

ALTER VIEW viewOwner 1 .viewName 1

This option specifies the fully qualified name of the view to be modified.

QUALIFIED

This option indicates whether the view was created with a qualified name.

QUALIFIED parameter values

Value

Description

YES

Indicates that the view was created with a qualified name.

NO

Indicates that the view was not created with a qualified name.

OWNER viewOwner 2

This option specifies the new owner of the view.

NAME viewName 2

This option specifies the new name of the view.

CHECK OPTION

This option specifies the new check option for the view. Views that reference global temporary tables cannot specify CHECK OPTION.

CHECK OPTION parameter values

Value

Description

LOCAL

Specifies that all search conditions are checked conditionally.

YES

Specifies that all search conditions are checked, regardless of the check options specified.

CHECK OPTION YES creates a cascaded view.

NO

Specifies not to use the definition of the view to check operations that use the view.

COMMENT 'string'

This option defines a comment for the view.

NOCOMMENT

This option removes an existing comment.

LABEL 'string'

This option defines a label for the view.

NOLABEL

This option removes an existing label.

COLCOMMENT columnName 'string'

This option defines a comment 'string' on columnName.

NOCOLCOMMENT columnName

This option removes an existing column comment from columnName.

COLLABEL columnName 'string'

This option defines a label 'string' on columnName.

NOCOLLABEL columnName

This option removes an existing column label from columnName.

COLUMNS (columnName, ...)

This option specifies the names of the columns to be included in the view.

Note

The COLUMNS parameter is used when the view does not contain an explicit column list. The ALTER COLUMN, ADD COLUMN, and DROP COLUMN parameters are used when the view contains an explicit column list.

NOCOLUMNS

This option removes the column list from the view definition. Columns appear in the order that is specified in the SELECT clause.

ALTER COLUMN columnName 1 (NAME columnName 2)

This option specifies a new name for a column.

Note

The ALTER COLUMN parameter is used when the view contains an explicit column list. The COLUMNS statement is used when the view does not contain an explicit column list.

ALTER COLUMN columnName 1 (MOVE BEFORE columnName 3)

Moves a column before another column.

Note

The ALTER COLUMN parameter is used when the view contains an explicit column list. The COLUMNS statement is used when the view does not contain an explicit column list.

ALTER COLUMN columnName 1 (MOVE AFTER columnName 3)

Moves a column after another column.

Note

The ALTER COLUMN parameter is used when the view contains an explicit column list. The COLUMNS statement is used when the view does not contain an explicit column list.

ADD COLUMN columnName 1 BEFORE columnName 2

This option adds a new column before another column.

Note

The ADD COLUMN parameter is used when the view contains an explicit column list. The COLUMNS parameter is used when the view does not contain an explicit column list.

ADD COLUMN columnName 1 AFTER columnName 2

This option adds a new column after another column.

Note

The ADD COLUMN parameter is used when the view contains an explicit column list. The COLUMNS parameter is used when the view does not contain an explicit column list.

DROP COLUMN columnName

This option removes a column.

Note

The DROP COLUMN parameter is used when the view contains an explicit column list. The COLUMNS parameter is used when the view does not contain an explicit column list.

PATH (schemaList)

This option specifies the path for this view.

AS SELECT subselect

This option defines a new SQL subselect statement as the definition for the view. If specified, the new select statement must appear last in the ALTER VIEW statement, after any other clauses.

Related topic



 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*