Synchronization Server Help


Filtering data in the subscription

When you create a subscription to a particular table (the PATIENTS table for your group of visiting nurses, for example), performance considerations might force you to replicate only a subset of the data in the table. You specify this subset by choosing individual rows or columns to be replicated for each table in the subscription.

For example, you might decide that the only columns relevant for visiting nurses using the PATIENTS table are the PATIENT_NAME, ADDRESS, PHONE, and DOCTOR fields. You might then decide to further filter the data by defining a WHERE clause that filters data for nurses working for a particular doctor.

You can combine data filters for the subscription with filters set for the group or for individual users to pare down the data even further.

These steps are part of the larger task of creating a JDBC subscription or editing a JDBC subscription. When you complete the steps for filtering data, return to the main task.


Figure dsyh016 not displayed.

To filter the data that will be replicated during synchronization:

  1. From the Define Replication Subscription window, click Advanced. The Advanced Replication Definition notebook opens.

  2. Optional: Select the columns to use in the subscription.

    1. Go to the Target Columns page of the Advanced Replication Definition notebook.

    2. Select the columns to create on the mobile device using the Subscribe checkbox. Columns not selected will not be created on the mobile device.

    3. Select the columns to replicate to the mirror database using the Replicate checkbox. You may need to replicate a column to the mirror database, but not want to create it on the handheld. For example, if a NOT NULLABLE column without a DEFAULT VALUE exists on the server and you are not creating it on the mobile device, you must replicate it to the mirror database and supply a default value using the Default value data filter. The Sync Server will replicate any rows created by the mobile device to the source using the DEFAULT VALUE specified in the Default value data filter to complete the contents of the NOT NULLABLE source column that does not have a default value on the server.

    4. Click Change to modify a target column name, Default value data filter, or constraint.

    5. Click Close to close the Create Index window.

  3. Optional: Define indexes for the target table.

    1. Go to the Indexes page of the Advanced Replication Definition notebook.

    2. Click Add to open the Create Index window. The Create Index window opens.

    3. Type the name index in the Name field.

    4. Select the columns you want to include in the index using the >, >>, <, and << push buttons.

    5. Order the index using the Move Up and Move Down push buttons.

    6. Select Ascending or Descending index.

    7. Click Add to add the index.

    8. Click Close to close the Create Index window.

  4. Optional: Define a WHERE clause that selects individual rows to be included in the subscription. You might decide that you want only certain rows to be part of the subscription even if you chose all columns to appear in the replica.

    1. Go to the Rows page of the Advanced Replication Definition notebook.

    2. In the All rows needed field, type a WHERE clause that defines the subset of rows that you want to appear in the subscription. For example, suppose that you want your visiting nurses to see only the rows of data in the PATIENTS table where the value of the JOBCODE column is VNURSE. You could type the following WHERE clause:
      WHERE JOBCODE='VNURSE'
      

    3. Optional: In the Subset of rows for individual users field, type a WHERE clause for individual users that overrides the WHERE clause for the subscription. For example, suppose that you want users to see data related to their own jobcodes. Instead of hard-coding a value for the JOBCODE parameter for the entire subscription, define a variable that references the data filter value defined for each individual user:

      WHERE JOBCODE=':JOB'
      

      Later you could go to the Data Filter page of the Edit User notebook and set the JOB parameter to each user's job code. See Filtering the data available to the user for more information on filtering data for individual users.

  5. Click OK to return to the Define Replication Subscription window.

[Return to creating a JDBC subscription or editing a JDBC subscription]


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]