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 For INSERT statements at a remote database to replicate correctly to the

remote databases 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

Dept

 

INSERT

1

Ann

101

Insert fails

INTO SalesRep (ID, Rep)

 

 

 

2

Marc

101

VALUES (3, 'Shih' )

 

 

3

Shih

X

 

 

 

 

 

 

Remote

INSERT

INTO SalesRep (ID, Rep)

VALUES (3, 'Shih' )

ID

Rep

1

Ann

 

 

2

Marc

 

 

3

Shih

 

 

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

Page 121
Image 121
Sybase DC38133-01-0902-01 manual Conditions for valid articles, Design tips for performance