ComponentOne Query 8.0
Multi-Table Views

After importing a database structure, you can create multi-table views. To add a table to a view, drag a table from the table's palette and drop it on a view in the Views palette or use the Add table button in a View Designer window.

Creating a multi-table view, you can represent a closely related group of tables as a single view, a single information unit. For example, you may need to add the ProductName field to the OrderDetails table, but the ProductName field is stored in another table, Products. Then you can add the Products table to the OderDetails view, so it will become a multi-table view with two tables: OrderDetails and Products. The OrderDetails table is the main table, the Products table is connected (joined) to it with the following join condition: OrderDetails.ProductID = Products.ProductID.

By selecting a table node you can review/modify properties that specify how multiple tables are joined to form a single view: Required, Join type and Conditions. The first table, being the main table of the view does not have these properties. The order of tables in a view is essential: every table except the first one is joined to the preceding tables.

Using a multi-table view in a query includes the view tables into the generated SQL, with joins specified in the View Designer. By unchecking the Required check box, you can make a table optional, that is, included in the generated SQL statement only if its field are directly specified or indirectly referenced in the user query. By default, all tables of a multi-table view are required, meaning that they are all included in the generated SQL once a field belonging to this view is requested in the user query.

Join conditions joining a table to the preceding tables are shown in the Conditions list box. You must specify at least one join condition for every table in a view except the first (main) table. To add a join condition, use the Add button to the left of the Conditions list box. Use the Edit and Remove buttons to edit/remove a join condition. The Join type combo box controls the type of the join connecting a table to the preceding tables: inner, outer or full join.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback