SQL Remote User's Guide
SQL Remote Design for Adaptive Server Anywhere
Publishing data
You can specify a WHERE clause to include in the publication only the rows that satisfy the WHERE conditions.
To create a publication using a WHERE clause (Sybase Central)
Connect to the database as a user with DBA authority.
In the left pane, select the Publications folder.
From the File menu, choose New
The Publication Creation wizard opens.
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 then type the search condition in the lower box.
Click Finish.
To create a publication using a WHERE clause (SQL)
Connect to the database as a user with DBA authority.
Execute a CREATE PUBLICATION statement that includes the rows 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 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 is a single-article publication sending relevant order information to Samuel Singer, a sales rep:
CREATE PUBLICATION pub_orders_samuel_singer ( TABLE sales_order WHERE sales_rep = 856 )
For more information, see the CREATE PUBLICATION statement.
SUBSCRIBE BYThe create publication statement also allows a SUBSCRIBE BY clause. This clause can also be used to selectively publish rows in SQL Remote. However, it is ignored during MobiLink synchronization. |