Expand a Parent Table to include all of it's Child Tables
This example will show you how to use the Expand Selected Table dialog to add all the related child tables for a parent table. We will select the Customer table as the parent, and use TurboData to add all the tables with a foreign key pointing to the Customer table.
To expand the Customer table execute the following Steps:
- Close all dialogs to return to the TurboData primary window.
- Press the Insert Data tab.
- From the Scenario menu, select the New Scenario option.
- Enter the Name 'Expand a Parent', and press OK.
- The Edit Insert Scenario dialog will be opened automatically. Click on the 'Customer' table, keep the mouse button down, and drag the arrow icon over to the right hand tree. Release the mouse button.
- Click on the Customer table that you now see in the right tree to give it focus.
- Enter '1' in the Start Range, and '5' in the End Range

- Press the Expand pushbutton to open the Expand Selected Table dialog.

- The Customer table is level 1. You cannot change the start and end range here.
- Click on the grid.
- Enter '1' in the Start Range, and '5' in the End Range on the first row of the grid. This should set the quantity for the level 2 children to 25 (5 * 5). Therefore, 5 children at level 2 will be generated for each parent.
- Enter '1' in the Start Range, and '5' in the End Range on the first row of the grid. This should set the quantity for the level 5 children to 125 (5 * 5 * 5). Therefore, 5 children at level 3 will be generated for each child at level 2.
- Press the Expand push button. This will start the Expansion process, and TurboData will add the child tables to the Insert Data Scenario.
- Click OK when the expansion is complete, and close the Expand Selected Tables dialog.
- You will now be returned to the Edit Insert Data Scenario dialog.
- The Order and Order Line tables are added to the list of tables to generate data for. The foreign keys for the child tables will be resolved to the parent Customer table!
- View the foreign key settings with the Set Foreign Keys dialog or press the Generate push button to generate the test data.