Joining Data on Blocks

Joins are used to restrict the data displayed on the child block according to a comparison between a column on the child block and a column on the parent block.  When you are creating entities with multiple blocks, often the information on the child block is dependent on the data on the parent block.  This dependency works for both displaying existing records on the child block and entering new records on the child block, as those new records should also be joined to the parent record.

This is handled in Xephr® by using joins .  The join is defined on the child block and defines the parent block and column that is joined to one of its own columns.  There are several kinds of joins, although equal joins are the most commonly used.

When creating blocks on an entity within the wizard, equal joins are created automatically for child blocks that have the Key Field property set to true for a column that is named the same as a key column on the parent block.  The join is created with the name the same as the column.  This join is created with an equal operator.

When an equal join is created for the child block, the data displayed on the child block will be restricted to that which has the same value in the from column on the child block as the value in the to block and to column.  Also, when new records are created, the from column in the child block will be automatically populated with the value from the to block and to column.  

Any block that is displayed above the child block can be joined to the child block.  Blocks on the same level as the child block cannot be joined to the child block.

Joins with Null Values

Joins with null values work as follows:

Creating Joins

  1. In the Explorer Tree, locate the object to which you wish to add a join.  

  1. Right-click on the block, hold your cursor over the New option, and when the sub-menu is displayed, drag your cursor over the Wizard option.  The final sub-menu will be displayed.  Left-click on the Join option.  

  2. The Join Creation Wizard will be displayed.

  3. In the From Column property, select the column on the child block that will be joined to the parent block.

  4. In the To Block property, select the block that contains the column to which the from column will be joined.

  5. In the To Column property, select the column to which you are joining the from column.

  6. The join will be created and added to the block.  Joins are created as equal joins automatically.

Modifying Joins

  1. In the Explorer Tree, locate the join that you wish to modify.

  1. Modify the join properties.  These will either be displayed in Alphabetical or Logically, depending on the setting of the [Sort Alphabetically/Logically] button.  The following instructions are assuming that the properties are sorted logically.

  2. In the Name field, enter the name for the join.  The default is the name of the from column.

  3. In the From Block field, the name of the child block is displayed.  This value cannot be changed.

  4. In the From Column property, select the column on the child block that will be joined to the parent block.

  5. In the To Block property, select the block that contains the column to which the from column will be joined.

  6. In the To Column property, select the column to which you are joining the from column.

  7. In the Operator property, select the join operator.  The selection here determines how the data on the child block will be restricted for this join.  Choices are:

    Equal - where a = b
    Not Equal - where a != b
    Less Than - where a < b
    Less Than or Equal - where a <= b
    Greater Than - where a > b
    Greater Than or Equal - where a >= b
    Like - where a like b
    Not Like - where a not like b

  8. Click on the Save button in the main toolbar to save the changes.

Xephr is a registered trademark of NDS Systems, LC.

Copyright © 2007 NDS Systems LC.