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

SQL Anywhere 17 » UltraLite - Database Management and Developer Guide » UltraLite SQL reference » UltraLite SQL statements

CREATE PUBLICATION statement [UltraLite]

Creates a publication.

Syntax
CREATE PUBLICATION [ IF NOT EXISTS ]publication-name
( TABLE table-name [ WHERE search-condition ], ... ) 
Parameters
  • IF NOT EXISTS clause

    When the IF NOT EXISTS clause is specified and the named publication already exists, no changes are made and an error is not returned.

  • TABLE clause

    Use the table to include a TABLE in the publication. There is no limit to the number of TABLE clauses.

  • WHERE clause

    If a WHERE clause is specified, only rows satisfying search-condition are considered for upload from the associated table during synchronization.

    If you do not specify a WHERE clause, every row in the table that has changed in UltraLite since the last synchronization is considered for upload.

Remarks

A publication identifies synchronized data in an UltraLite remote database.

A publication establishes tables that are synchronized during a single synchronization operation, and determines which data is uploaded to the MobiLink server. The MobiLink server may send back rows for these (and only these) tables during its download session; however, rows that are downloaded do not have to satisfy the WHERE clause for a table.

Only entire tables can be published. You cannot publish specific columns of a table in UltraLite.

Side effects
  • Automatic commit.

Example

The following statement publishes all the columns and rows of two tables.

CREATE PUBLICATION pub_contact (
   TABLE Contacts,
   TABLE Customers
)

The following statement publishes only the rows of the Customers table where the State column contains MN.

CREATE PUBLICATION pub_customer (
   TABLE Customers 
   WHERE State = 'MN'
)