Sybase SQL Remote DC38133-01-0902-01 User Manual

Page of 485
Chapter 7. SQL Remote Design for Adaptive Server Anywhere
These key features of relational databases must be incorporated into the
design of your publications and subscriptions. This section describes
principles and techniques for sound design.
Conditions for valid articles
All columns in the primary key must be included in the article.
Supporting INSERTS at
remote databases
For INSERT statements at a remote database to replicate correctly to the
consolidated database, you can exclude from an article only columns that
can be left out of a valid INSERT statement. These are:
Columns that allow NULL.
Columns that have defaults.
If you exclude any column that does not satisfy one of these requirements,
INSERT statements carried out at a remote database will fail when
replicated to the consolidated database.
Consolidated
ID
Rep
Ann
2
1
Marc
Remote
ID
Rep
2
1
Ann
Marc
Dept
101
101
3
Shih
3
Shih
X
INSERT
INTO SalesRep (ID, Rep)
VALUES (3, 'Shih' )
INSERT
INTO SalesRep (ID, Rep)
VALUES (3, 'Shih' )
Insert fails
Insert
succeeds
Using BEFORE triggers as an alternative
An exception to this case is when the consolidated database is an Adaptive
Server Anywhere database, and a BEFORE trigger has been written to
maintain the columns that are not included in the INSERT statement.
Design tips for performance
This section presents a checklist for designing high performance
SQL Remote installations.
103