14.3. Altering Views


To change the definition of an existing view, use the ALTER VIEW statement. ALTER VIEW discards the current definition for the view and replaces it with the new definition in the statement. It is an error if the named view does not exist. Syntactically, the only differences from CREATE VIEW are that the initial keyword is ALTER rather than CREATE, and the OR REPLACE option cannot be used.

The following statement redefines the LargePop view created in the previous section so that it no longer includes a WITH CHECK OPTION clause:

 ALTER VIEW LargePop AS SELECT Name, Population FROM CountryPop WHERE Population >= 100000000; 



MySQL 5 Certification Study Guide
MySQL 5.0 Certification Study Guide
ISBN: 0672328127
EAN: 2147483647
Year: 2006
Pages: 312

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net