Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » MobiLink - Client Administration » SQL Anywhere Clients » Publishing data

Publishing only some columns in a table Next Page

Publishing only some rows in a table


When no WHERE clause is specified in a publication definition, all changed rows in the publication are uploaded. You can add WHERE clauses to articles in the publication to limit the rows to be uploaded to those that have changed and that satisfy the search condition in the WHERE clause.

The search condition in the WHERE clause can only reference columns that are included in the article. In addition, you cannot use any of the following in the WHERE clause:

These conditions are not enforced, but breaking them can lead to unexpected results. Any errors relating to the WHERE clause are generated when the DML is run against the table referred to by the WHERE clause, and not when the publication is defined.

To create a publication using a WHERE clause (Sybase Central Admin mode)
  1. Connect to the remote database as a user with DBA authority using the SQL Anywhere plug-in.

  2. Open the Publications folder.

  3. From the File menu, choose New > Publication.

    The Create Publication wizard appears.

  4. Enter a name for the new publication. Click Next.

  5. On the Tables tab, select a table from the list of Available Tables. Click Add. The table is added to the list of Selected Tables on the right.

  6. On the WHERE Clauses tab, select the table and enter the search condition in the lower box. Optionally, you can use the Insert dialog to assist you in formatting the search condition.

  7. Click Finish.

To create a publication using a WHERE clause (SQL)
  1. Connect to the remote database as a user with DBA authority.

  2. Execute a CREATE PUBLICATION statement that includes the tables you want to include in the publication and a WHERE condition.

    See CREATE PUBLICATION statement [MobiLink] [SQL Remote].

  3. Example

    The following example creates a single-article publication that includes all sales order information for sales rep number 856.

    CREATE PUBLICATION pub_orders_samuel_singer
     ( TABLE SalesOrders
         WHERE SalesRepresentative = 856 )