Creating and modifying publications

You create publications using Sybase Central or the SQL CREATE PUBLICATION statement. In Sybase Central, all publications and articles appear in the Publications folder. This section describes how to create publications in Sybase Central. For information about creating and modifying publications using SQL, see the MobiLink - Client Administration book.

Connecting to Sybase Central

You use the SQL Anywhere plug-in in Sybase Central, not the MobiLink Synchronization plug-in, to work with MobiLink clients and remote databases. The SQL Anywhere plug-in has a MobiLink Synchronization Client folder where you perform all actions related to remote databases.

You must have DBA authority to create or modify publications, MobiLink users, and subscriptions.

StepsTo connect to Sybase Central to work with MobiLink Synchronization clients:

  1. Start Sybase Central, select Tools>Connect from the menu bar, select SQL Anywhere from the New Connection dialog box, and click OK.

  2. On the Identification page in the Connect dialog box, enter DBA as the user name and SQL as the password, select the ODBC DataSource Name radio button, browse to select the DSN of the remote database, and click OK.

  3. In the SQL Anywhere plug-in, expand the node for the remote database and open the MobiLink Synchronization Client folder.

Publishing all the rows and columns in a table

The simplest publication you can make is a single article that consists of all rows and columns of one or more tables. The tables must already exist.

StepsTo publish one or more entire tables in Sybase Central:

  1. Connect to Sybase Central as described in “Connecting to Sybase Central”.

  2. Open the Publications folder and double-click Add Publication.

  3. Type a name for the new publication and click Next.

  4. On the Tables page, select a table from the list of Matching Tables and click Add.

    The table appears in the list of Selected Tables on the right.

  5. Optionally, add more tables. The order of the tables is not important.

  6. Click Finish.

Publishing only some columns in a table

You can create a publication that contains all the rows but only some of the columns of a table.

StepsTo publish only some columns in a table in Sybase Central:

  1. Follow the first four steps of the procedure in “Publishing all the rows and columns in a table”.

  2. On the Columns page, double-click the table's icon to expand the list of available columns, select each column you want to publish, and click Add.

    The selected columns appear on the right.

  3. Click Finish.

Publishing only some rows in a table

You can create a publication that contains some or all of 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.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.

StepsTo create a publication using a WHERE clause in Sybase Central:

  1. Follow the first four steps of the procedure in “Publishing all the rows and columns in a table”.

  2. On the Where page, select the table and type the search condition in the lower box.

    Optionally, you can use the Insert dialog box to help you format the search condition.

  3. Click Finish.

Adding articles

You can add articles to existing publications.

StepsTo add articles in Sybase Central:

  1. Connect to Sybase Central and open the MobiLink Synchronization Client folder as described in “Connecting to Sybase Central”.

  2. Open the Publications folder and double-click the name of the publication to which you want to add an article.

  3. Double-click Add Article.

  4. In the Article Creation wizard, select a table and click Next.

  5. If you want only some columns to be synchronized, select the Selected Columns radio button and select the columns.

  6. If you want to add a WHERE clause, click Next and enter the clause.

  7. Click Finish.

Modifying and removing publications and articles

You can modify or drop existing publications in Sybase Central by navigating to the location of the publication and selecting Properties or Delete from its pop-up menu. You can modify and remove articles in the same way.

Publications can be modified only by the DBA or the publication's owner. You must have DBA authority to drop a publication. If you drop a publication, all subscriptions to that publication are automatically deleted as well.

NoteAvoid altering publications in a running MobiLink setup Altering publications in a running MobiLink setup is likely to cause replication errors and can lead to loss of data unless carried out with care.