Chapter 3 Building Physical Diagrams
A join is a link between a column in a parent table or view and a column in a child table or view that is defined within a view reference.
If you create a new view from existing views, the joins defined on these views influence the WHERE statement in the SQL query of the new view.
French_Store is a view of table Store. You define a join between Store_ID in the table and STORE_STORE_ID in the view.
Customer_Orders is a view of table Orders. You define a join between Order_No in the table and ORDER_ORDER_N in the view.
You create a view reference between French_Store and Customer_Order in which you define a join between ORDER_ORDER_STORE and STORE_STORE_ID. This is to establish a correspondence between the store ID and the store where the order is sent.
If you create a view from French_Store and Customer_Orders, you can check in the SQL query page of the view that the SELECT order takes into account the join defined between the views. The SELECT statement will retrieve orders sent to French stores only.
In the Joins page of a view reference property sheet, you can use the Reuse Columns tool to reuse existing child columns with same code as parent columns.
To define joins in a view reference:
Copyright (C) 2005. Sybase Inc. All rights reserved. |