Adding Tables to a Resource

Adding Tables to a Resource

When you create a resource from scratch, or based on an HTML page or a DTD, the Data Pipe does not include a Backend Data Tank. You must add a table to the Data Pipe to create the Backend Data Tank. If you already have a Backend Data Tank, you can add additional tables. You should also add joins to the tables. When you add multiple tables to the Backend Data Tank, Percussion creates any joins it can guess (for example, columns that share the same name). You can also additional joins.

If you plan to use manual SQL in the Selector, you can skip editing joins. Joins created in manual SQL override joins created in the Join Editor.

To add a table to a resource:

  1. Display the Database Explorer.
  2. Find the table you want to add to the resource. Select it and drag it into the resource tab.
  3. If the Data Pipe does not already include a Backend Data Tank, the join point is highlighted. Drop the table on the join point. The Workbench adds a Backend Data Tank.
  4. If the Data Pipe already includes a Backend Data Tank, drop the table on it.

    Percussion adds the table to the Backend Data Tank and creates any joins it can guess automatically. You can also add more joins manually.

Managing Joins

When you add more than one table to the Backend Data Tank for a resource, Percussion automatically generates any joins it can guess. In most cases, any columns that share the same name will be joined. All joins created by Percussion are inner joins by default.

Data on the left-hand-side of the join can be translated before comparison. The first table selected when you create a join is always the left-hand-side of the join, and is indicated by an arrow. (Note: in joins generated by Percussion, any tables that already exist in the Backend Data Tank will be the left-hand-side of the join.)

To maintain joins, use the Join editor. To access the Join editor, double-click on the Backend Data Tank.

To add a new join select the table column in the first table, drag your cursor to the column in the second tab and release. Percussion creates the join between the two tables. The join is represented by a line between the columns in the two table objects.

To change the properties of a join:

  1. Right-click on the join whose properties you want to manage.

    The Workbench displays the Join Properties dialog.

  2. To change the Join Type, select the radio button for the type you want. Options are:
    • Inner Join (default)
    • Left Outer Join
    • Right Outer Join
    • Full Outer Join
  3. To translate data on the left-hand-side of the join, check the Enable join translation to be applied to the left side checkbox. Click the [Edit Formula] button to display a function editor you can use to select the function to perform the conversion and to define the values for any parameters in the function.
  4. Click the [OK] button to save your changes.

Leave a comment