| Home | JSP | EJB | JDBC | Java Servlets | WAP | Free JSP Hosting | Spring Framework | Web Services | BioInformatics | Java Server Faces | Jboss 3.0 tutorial | Hibernate 3.0 | XML | ||||
|
||||
| Tutorial Categories: Ajax
| Articles
| JSP
| Bioinformatics
| Database
| Free
Books |
Hibernate
| J2EE
| J2ME
| Java
| JavaScript
| JDBC
| JMS
| Linux
| MS
Technology |
PHP
| RMI
| Web-Services
| Servlets
| Struts
| UML
|
ViewsVIEW is a virtual table, which acts like a table but actually it contains no data. That is based on the result set of a SELECT statement.
A VIEW consists rows and columns from one or more than one tables. A VIEW is a query that’s stored as an object. A VIEW is nothing more than a way to select a subset of table’s columns. By using Views you can ensure about the security of data by restricting access to the following data:
CREATE VIEW Statement View_name specifies the name for the new view. column_list specifies the name of the columns to be used in view.
column_list must have the same number of columns that specified in select_statement. If
column_list option is not available then view is created with the same columns that specified in
select_statement. Some restrictions imposed on views are given below :
Example :
Example : Create View Statement
In the following example we include the WHERE clause with the select statement of view. Then MySQL adds this condition to the VIEW definition when executing the statement for further restricting the result. Example :
ALTER VIEW Statement By the ALTER VIEW Statement we can change the definition of a view. This statement is useful to modify a view without dropping it. ALTER VIEW statement syntax is similar to CREATE VIEW Statement and effect is same as the CREATE OR REPLACE VIEW. The general syntax of ALTER VIEW Statement is : In the following example we are altering the view definition that we have created above. In this we add one more column by the name of Prod_Detail of Products table. Example of Altering the View Statement :
DROP VIEW Statement For dropping a view you can use the DROP VIEW Statement. When view is dropped but it has no effect on the underlying tables. After dropping a view if you issue any query that reference a dropped view then you get an error message. But dropping a table that reference any view does not drop the view automatically you have to dropt the view explicitly. The general syntax of DROP VIEW Statement is : In the following example we are dropping the view that we have created above. Example of Dropping the View Statement :
|
| Facing Programming Problem? | |||||||
| Add This Tutorial To: | |||||||
| |
|
|
|
|
|
|
|
![]() |
|
JDO Tutorials EAI Articles Struts Tutorials Java Tutorials Java Certification |
|
|
|
||||||||||||||||||||||||||||||
|
Home | JSP | EJB | JDBC | Java Servlets | WAP | Free JSP Hosting | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs |
||||||||||||||||||||||||||||||
Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.
Copyright © 2007. All rights reserved.
Current Comments
0 comments so far (post your own) View All Comments Latest 10 Comments: