Skip to content

Creating the Order Header Table

You will now create the Order Header Table for the Order Entry sample application.

  1. Click the Create New Table button on the Table Explorer toolbar.
    In the Create New Table dialog, type OrderHeader as the Table Name and click Ok.
    The new table will open in the Table Editor.

  2. Add columns to the table schema until your column definitions look like those in the image below.

Next, you will add indexes for this table.

  1. Click on the Add Index toolbar button on the Index tab to add a new index.
    Enter the Segments grid and select Order_Number as the column to add as the first index segment from the combo box. This is the only segment for the first index, meaning that we will never be allowed to have two orders with the same number. This is what we want.

The completed index should look like this:

  1. Click on the Add Index toolbar button to add index 2. The segments of this index will be Customer_Number and Order_Number.

The completed index should look like this:

  1. Click on the Add Index toolbar button to add index 3. The segments of this index will be Order_Date and Order_Number.

The completed index should look like this:

Next, you will add relationships for this table.

  1. Click on the Add Relationship toolbar button on the Relationships tab to add a new relationship.
    This will open the Add a Relationship dialog.
    Select the Customer table and click Ok.

  1. In the relationship Column Pairs grid, select Customer_Number in the From OrderHeader column and Customer_Number in the To Customer column.

The completed relationship should look like this:

  1. Click on the Add Relationship toolbar button on the Relationships tab to add another relationship.
    This will open the Add a Relationship dialog.
    Select the SalesP table and click Ok.

  2. In the relationship Column Pairs grid, select Salesperson_Id in the From OrderHeader column and Id in the To SalesP column.

The completed relationship should look like this:

  1. Click the Save File toolbar button (or press Ctrl + S) to save the table schema.

    The Output window will display the results of the save operation.
    Note that a Data Dictionary is automatically created when you create a new table (when you save the table the first time).

Next Step

Creating the Inventory Parts Table