MobiLink Synchronization User's Guide
Adaptive Server Anywhere Clients
Publishing data
You can create a publication that contains some or all the columns in a table, but only some of the rows. You do so by writing a search condition that matches only the rows you want to publish.
Sybase Central and the SQL language each provide two ways of publishing only some of the rows in a table; however, only one way is compatible with MobiLink.
WHERE clause Compatible with MobiLink. You can use a WHERE clause to include a subset of rows in an article.
Subscription expression Ignored by MobiLink.
In MobiLink, you can use the WHERE clause to exclude the same set of rows from all subscriptions to a publication. All subscribers to the publication upload any changes to the rows that satisfy the search condition.
To create a publication using a WHERE clause (Sybase Central)
Connect to the remote database as a user with DBA authority using the Adaptive Server Anywhere plug-in.
Open the Publications folder.
From the File menu, choose New
Type a name for the new publication. Click Next.
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.
On the WHERE Clauses tab, select the table and type the search condition in the lower box. Optionally, you can use the Insert dialog to assist you in formatting the search condition.
Click Finish.
To create a publication using a WHERE clause (SQL)
Connect to the remote database as a user with DBA authority.
Execute a CREATE PUBLICATION statement that includes the tables you wish to include in the publication and a WHERE condition.
The following statement creates a publication that publishes the id, company_name, city, and state columns of the customer table, for the customers marked as active in the status column.
CREATE PUBLICATION pub_customer ( TABLE customer ( id, company_name, city, state ) WHERE status = 'active' )
In this case, the status column itself is not published. All unpublished rows must have a default value. Otherwise, an error occurs when rows are downloaded for insert from the consolidated database.
The following example creates a single-article publication that includes order information for sales rep number 856.
CREATE PUBLICATION pub_orders_samuel_singer ( TABLE sales_order WHERE sales_rep = 856 )
For more information, see the CREATE PUBLICATION statement. Note that the CREATE PUBLICATION statement includes a SUBSCRIBE BY clause. This clause can be used to selectively publish rows in SQL Remote. However, it is ignored during MobiLink synchronization.