Database Views

A database view is simply a subset of the database sorted and displayed in a particular way.  A database view limits the records displayed and could contain a subset of records, such as "products that are in stock", or "customers that have purchased goods greater than $1000".  A view could also contain a subset of the information for each item, such as "product name, description and price", but not the dimensions of the product.  Similarly, the order of the columns is specified in the database view as well.  Some applications use database views or stored procedures to embed security in the database so that the application cannot compromise security regardless the query used.

Because database views are an integral part of your underlying database structure, it’s important that your application embrace them.  Many organizations use database views as a way of consolidating data for reporting and other uses where a common “definition” is required.

Applications generated by Iron Speed Designer fully support database views.  For each view, you can control which columns are displayed, what order they are displayed in, how wide each column is, how the data is sorted, and what types of records to display.  In general, you can perform any operation on a database view in Iron Speed Designer that you can on any table with the exception of inputting data into the view.  This must be done by inputting data into the underlying tables from which the database view is derived.

Note, however, that you cannot create database views in Iron Speed Designer.  Views must be created with other database tools before Iron Speed Designer can use them.

A screen shot from Iron Speed Designer showing a combination of tables and database views included in an application.

Caveats

In order to generate unique rows, Iron Speed Designers requires a database view to include all keys used to filter the query.  For instance, the following database view returns duplicates if the foreign key field PersonID is displayed in a table showing the database view.

SELECT Type

FROM Employees

WHERE Type = 4

Instead, to return unique rows, modify your database view to include the foreign key:

SELECT Type, PersonID

FROM Employees

WHERE Type = 4

See Also

Transaction Management