Replace views using ALTER VIEW statement - Oracle Views, Sequences, and Synonyms

Q.  You cannot use an ALTER VIEW statement to change the definition of a view but you can replace views in which of the following ways?
- Published on 13 Aug 15

a. You can drop and recreate the view
b. You can redefine the view with a CREATE VIEW statement that contains the OR REPLACE clause
c. Both A & B
d. None of the above

ANSWER: Both A & B
 

    Discussion

  • Nirja Shah   -Posted on 29 Sep 15
    - To replace a view, you must have all of the privileges required to drop and create a view.

    - If the definition of a view must change, the view must be replaced.

    - You cannot use an ALTER VIEW statement to change the definition of a view.

    - You can replace views in the following ways:

    1. You can drop and re-create the view.

    2. You can redefine the view with a CREATE VIEW statement that contains the OR REPLACE clause.
    - The OR REPLACE clause replaces the current definition of a view and preserves the current security authorizations.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)