This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Actually, views can be used in many places where tables are allowed. This also is what makes them useful. An application doesn't even necessarily need to know whether it is querying a table or a view.
Some views can even be updatable, meaning you can insert, update or delete records in them. Rules determining which views are updatable can differ slightly among databases. Generally, if there is a one to one relationship between rows in a view and rows in the underlying table(s), the view can be updated. So, for example: is usually updatable in most databases, while isn't.
Sometimes even views containing joins can be updated, but this is where the topic starts to get somewhat complicated.
In queries, you can treat views as if they were tables i.e. you can do joins, sub-queries etc. But it can be helpful to know what the SQL is doing underneath, especially in more complex views. You could have several views that perform similar queries underneath, so when you join them, you are effectively forcing the database to do unnecessary work. In this situation it might be better to write a fresh query against the tables to do exactly what you need.
No more Blub for me, thank you, Vicar.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com