COF-C02 · Question #219
How can a user change which columns are referenced in a view?
The correct answer is C. Recreate the view with the required changes. In Snowflake, to change the columns referenced in a view, the view must be recreated with the required changes. The ALTER VIEW command does not allow changing the definition of a view; it can only be used to rename a view, convert it to or from a secure view, or add, overwrite…
Question
How can a user change which columns are referenced in a view?
Options
- AModify the columns in the underlying table
- BUse the ALTER VIEW command to update the view
- CRecreate the view with the required changes
- DMaterialize the view to perform the changes
How the community answered
(32 responses)- A3% (1)
- B9% (3)
- C84% (27)
- D3% (1)
Explanation
In Snowflake, to change the columns referenced in a view, the view must be recreated with the required changes. The ALTER VIEW command does not allow changing the definition of a view; it can only be used to rename a view, convert it to or from a secure view, or add, overwrite, or remove a comment for a view. Therefore, the correct approach is to drop the existing view and create a new one with the desired column references.
Topics
Community Discussion
No community discussion yet for this question.