Chapter 7. SQL Remote Design for AdaptiveSer verAnywhere
Topublish only some columns in a table (SQL)
1. Connect to the database as a user with DBA authority.
2. Execute a CREATE PUBLICATION statement that specifies the
publicationname and the table name. Listthe published columns in
parenthesisfollowing the table name.
Example Thefollowing statement creates a publication that publishes all rows of
theid, company_name, and city columns of the customer table:
CREATE PUBLICATION pub_customer (
TABLE customer (
id,
company_name,
city )
)
Formore information, see the “CREATE PUBLICATION statement”
[ASASQL Reference, page 385].
Publishing only some rows in a table
Youcan create a publication that contains all the columns, but only some of
therows, of a table from Sybase Central. Ineither case, you do so by writing
asearch condition that matches only the rows you want to publish.
SybaseCentral and the SQL language provide two ways of publishing only
someof the rows in a table; however, only one way is compatible with
MobiLink.
WHEREclause Youcan use a WHERE clause to include a subset of
rowsin an article. Allsubscribers to the publication containing this
articlereceive the rows that satisfy the WHERE clause.
Subscriptionexpression Youcan use a subscription expression to
includea different set of rows in different subscriptions to publications
containingthe article.
Youcan combine a WHERE clause and a subscription expression in an
article. Youcan specify them in Sybase Central or in a CREATE
PUBLICATIONstatement.
Usethe Subscription expression when different subscribers to a publication
areto receive different rows from a table. The Subscription expression is the
mostpowerful method of partitioning tables.
Usethe WHERE clause to exclude the same set of rows from all
subscriptionsto a publication.
95