An essentially different possibility of adding a table in an EDB of ObjectLand is offered if at the first step of the table adding wizard the user chooses the radio button View (CREATE VIEW). Then the user is to make another choice from two possibilities. The figure 41-9 illustrates the case when the radio button based on table is chosen.
Figure 41-9. EDB table adding wizard, step 1 for a view table
In terms of SQL language a 'VIEW' is an object which is built by the data source server program on the base of tables stored in the data source, taking into consideration all the requirements imposed by the user, such as joining and sorting base tables, selecting appropriate columns, selecting records by a search condition etc. The notion of a view is nearly analogous to the notion of a query in ObjectLand. The difference lies in the fact that all operations of building a view are performed outside ObjectLand, by means of the data source server, and these operations are controlled by SQL statements generated when passing steps of the wizard. From the ObjectLand's point of view, a view built in such a way will be interpreted as a table in EDB, not as a query.
One should have in view that EDB tables built as views will be accessible in ObjectLand only if when creating the EDB on the page of connection modes (see figure 39-2) views were marked among used types of components. The mode of using views can also be activated the creation of EDB by means of EDB property sheet (chapter 42 “Properties of EDB and its components”).
Next steps of the table adding wizard are related with defining the operations used to build the view. In particular, the step 2 (figure 41-10) allows to define the scheme of joining tables in the view. At the same step reference tables for columns can be set because setting reference tables is considered as a special case of joining tables.
Figure 41-10. EDB table adding wizard, step 2 for a view table
Creation of the joining scheme is performed in the same way as for internal GDB tables (see chapter 28 “Joining tables”). After pushing the button Join a dialog box “Join” is opened (figure 41-11) where the user is to select the base field of the table, the joined table and a field in it. In the considered example the table “Reference of Streets” will be joined via the indexed field “Code” with the table “Building Certificates” using the field “Street Code”.
Figure 41-11. Dialog box “Join” for adding a EDB table
At the figure 41-12 the same wizard page is shown after joining reference tables of streets and materials with the table “Building Certificates”.
Figure 41-12. EDB table adding wizard, step 2 for a view table after performing join
The next three steps of the wizard are not shown here because they are related to specifying of search condition, sorting records and calculations in the table being created. All these settings are performed in just the same way as for a GDB query (see chapter 24 “Browsing a table”, chapter 26 “Searching records in a table” and chapter 29 “Calculations in a table”).
At the step 6 displayed columns of the table-view are selected. Since at the step 2 joining reference tables was performed, it make sense to hide the indexed fields used for joining and to rename the value fields of the reference tables, as shown at the figure 41-13.
Figure 41-13. EDB table adding wizard, step 6 for a view table
At the step 7 (figure 41-14) the user can inspect the generated SQL statement 'CREATE VIEW' and, if desirable, modify the parameters of this statement manually. After pushing the button Execute the last wizard page is opened on which the results of performing the statement are shown.
Figure 41-14. EDB table adding wizard, step 7 for a view table
Returning to the first step of the wizard (see figure 41-9), one can see that there is yet another possibility to create an EDB table as a view by selecting the radio button based on SQL expression. In this case all the wizard steps from 2 to 6 will be omitted and the next step (figure 41-15) will allow to write right away the required form of the SQL statement 'CREATE VIEW' manually.
Figure 41-15. EDB table adding wizard, step 2 for manual definition of a view table
Such a way of building view permits to take advantage of all the plenitude of a SQL statement's possibilities but it requires deep understanding and attention.