Sample: visualizing the car dealership database with the IMS DBD editor
This sample shows how to visualize the IMS™ databases in a car dealership business scenario.
Getting the sample files
You can find the sample files in your IMS Explorer installation directory, under the location <installaion location>\IMS Explorer samples.
- AUTODB.dbd
- Physical DBD for the dealership database.
- AUTOLDB.dbd
- Logical DBD for the dealership database.
- EMPDB2.dbd
- Physical DBD for the employee database.
- EMPLDB2.dbd
- Logical DBD for the employee database.
Sample scenario
The management of the car dealership company wants to be able to quickly retrieve the list of employees who serviced a particular order. As an application programmer, you are tasked with supporting this new business requirement. Your application must be able to access the employee data, which is stored in the employee database, by cross-reference against the order data, which is stored in the dealership database. To support this application requirement, you can create a logical database to tie the two databases together in a single application view. Before writing the PSB and DBD source to code the logical database, you can use the IMS Explorer to visualize the possible new logical database structure, based on existing logical relationships and secondary indexes.
In this scenario, you can assume that the database administrator has coded a secondary index with the DEALERDB.ORDER segment as the target. The database administrator has also coded a logical relationship between the DEALERDB.SALESPER and the EMPDB.EMPL segments.
After you create an IMS Explorer project and import the sample PSB and DBD files into the project, you can visualize the following database structures in the IMS DBD editor:
- Visualize the structure of the dealership database, with DEALERDB.DEALER
as the root segment.
- Under the project folder, expand DEALERDB.dbd). , and then double-click the database model (
- Visualize the secondary data structure with DEALERDB.ORDER as
the root segment.
- In the IMS DBD editor, select the ORDER segment.
- Right-click and select .
- In the secondary data structure, visualize the possible new logical
database structures that will result if you concatenate the logical
child segment DEALERDB.SALESPER with its logical parent EMPDB.EMPL.
- In the IMS DBD editor, select the SALESPER segment.
- Right-click and select .