14.4. Dropping Views


To destroy one or more views, use the DROP VIEW statement:

 DROP VIEW [IF EXISTS] view_name [, view_name] ... ; 

It is an error if a given view does not exist. Include the IF EXISTS clause to generate a warning instead. (The warning can be displayed with SHOW WARNINGS.) IF EXISTS is a MySQL extension to standard SQL. If the view v1 exists but the view v2 does not, the following DROP VIEW statement results in a warning for the attempt to drop v2:

 mysql> DROP VIEW IF EXISTS v1, v2; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> SHOW WARNINGS; +-------+------+--------------------------+ | Level | Code | Message                  | +-------+------+--------------------------+ | Note  | 1051 | Unknown table 'world.v2' | +-------+------+--------------------------+ 1 row in set (0.00 sec)  



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