Using passthrough mode

 

The publisher of the consolidated database can directly intervene at remote

 

sites using a passthrough mode, which enables standard SQL statements to

 

be passed through to a remote site. By default, passthrough mode statements

 

are executed at the local (consolidated) database as well, but an optional

 

keyword prevents the statements from being executed locally.

 

 

 

 

Caution

 

 

Always test your passthrough operations on a test database with a remote

 

 

database subscribed. Never run untested passthrough scripts against a

 

 

production database.

 

 

 

 

Starting and stopping

Passthrough mode is started and stopped using the PASSTHROUGH

passthrough

statement. Any statement entered between the starting PASSTHROUGH

 

statement and the PASSTHROUGH STOP statement which terminates

 

passthrough mode is checked for syntax errors, executed at the current

 

database, and also passed to the identified subscriber and executed at the

 

subscriber database. We can call the statements between a starting and

 

stopping passthrough statement a passthrough session.

 

The following statement starts a passthrough session which passes the

 

statements to a list of two named subscribers, without being executed at the

 

local database:

 

PASSTHROUGH ONLY

 

FOR userid_1, userid_2;

Directing passthrough

The following statement starts a passthrough session that passes the

statements

statements to all subscribers to the specified publication:

 

PASSTHROUGH ONLY

 

FOR SUBSCRIPTION TO [owner].pubname [ ( string ) ] ;

 

Passthrough mode is additive. In the following example, statement_1 is sent

 

to user_1, and statement_2 is sent to both user_1 and user_2.

 

PASSTHROUGH ONLY FOR user_1 ;

 

statement_1 ;

 

PASSTHROUGH ONLY FOR user_2 ;

 

statement_2 ;

 

The following statement terminates a passthrough session:

 

PASSTHROUGH STOP ;

 

PASSTHROUGH STOP terminates passthrough mode for all remote users.

Order of application of

Passthrough statements are replicated in sequence with normal replication

passthrough statements

 

 

260

Page 278
Image 278
Sybase DC38133-01-0902-01 manual Using passthrough mode