The subscription expression in this example returns a single value. Subqueries returning multiple values can also be used. The value of the subscription expression must the value after the UPDATE.

In this case, the only subscriber to the row is the new sales representative. In “Sharing rows among several subscriptions” on page 112 , we see cases where there are existing as well as new subscribers.

Information in the

Here we describe the information placed in the transaction log.

transaction log

Understanding this helps in designing efficient publications.

 

Assume the following data:

SalesRep table

rep_key

Name

rep1

 

Ann

rep2

 

Marc

Customer table

 

 

 

 

 

 

 

cust_key

 

name

 

rep_key

 

 

 

 

 

cust1

 

Sybase

 

rep1

cust2

 

ASA

 

rep2

Contact table

 

 

 

 

contact_key

 

name

 

cust_key

 

 

 

 

 

contact1

 

David

 

cust1

contact2

 

Stefanie

 

cust2

 

 

 

 

 

Now apply the following territory realignment Update statement

UPDATE Customer

SET rep_key = ’rep2’

WHERE cust_key = ’cust1’

The transaction log would contain two entries arising from this statement: one for the BEFORE trigger on the Contact table, and one for the actual UPDATE to the Customer table.

110

Page 128
Image 128
Sybase DC38133-01-0902-01 manual Understanding this helps in designing efficient publications, Assume the following data