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 online MobiLink - Client Administration book.

Connecting to the database in 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. For information on starting Sybase Central from the PowerBuilder design time environment, see the Users Guide.

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

StepsTo connect to the database in Sybase Central:

  1. Start Sybase Central, select Connections>Connect with SQL Anywhere 12 from the Sybase Central menu bar.

  2. On the Identification page in the Connect dialog box, enter DBA as the user name and SQL as the password, select or browse to the data source name or file and click OK.

Publishing all the rows and columns in a table

The simplest publication you can create 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 the database in Sybase Central”.

  2. Open the Publications folder and select File>New>Publication from the Sybase Central menu.

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

  4. On the Specify Tables page, select a table from the list of available 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. Click Next. On the Specify 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”, and optionally the first two steps of the procedure in “Publishing only some columns in a table”.

  2. Click Next. On the Specify Where Clauses 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 as described in “Connecting to the database in Sybase Central”.

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

  3. Select File>New>Article from the Sybase Central menu.

  4. In the Create Article 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.