If the view is not updatable, then there is no meaning of including this clause in the CREATE VIEW statement. The WITH CHECK OPTION clause in SQL is a very useful clause for views. In this example we will delete the last row from the view DetailsView which we just added in the above example of inserting rows. View_name:Name of view from where we want to delete rows Also deleting a row from a view first delete the row from the actual table and the change is then reflected in the view. We can use the DELETE statement of SQL to delete rows from a view. If we fetch all the data from DetailsView now as, SELECT * FROM DetailsView ĭeleting rows from a view is also as simple as deleting rows from a table. In the below example we will insert a new row in the View DetailsView which we have created above in the example of “creating views from a single table”. Syntax: INSERT INTO view_name(column1, column2, column3.) We can use the INSERT INTO statement of SQL to insert a row in a View. We can insert a row in a View in a same way as we do in a table. If we fetch all the data from MarksView now as: SELECT * FROM MarksView SELECT StudentDetails.NAME, StudentDetails.ADDRESS, StudentMarks.MARKS, StudentMarks.AGE #VIEW TABLE CREATED IN POSTICO UPDATE#Syntax: CREATE OR REPLACE VIEW view_name ASįor example, if we want to update the view MarksView and add the field AGE to this View from StudentMarks Table, we can do this as:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |