VERIFY_ALL_COLUMNS is set to OFF, if an UPDATE statement updates more than 128 columns, conflict resolution will not work.

A first conflict resolution example

 

In this example, conflicts in the Customer table in the two-table example

 

used in the tutorials are reported into a table for later review.

The database

The two-table database is as follows:

Customer

cust_key char(12)

name char(40)

rep_key char(5)

rep_key =

rep_key

SalesRep

rep_key char(5)

name char(40)

Goals of the conflict

The conflict resolution will report conflicts on updates to the name column

resolution

in the Customer table into a separate table named ConflictLog .

The conflict resolution

The conflict resolution tables are defined as follows:

objects

CREATE TABLE OldCustomer(

 

 

cust_key CHAR( 12 ) NOT NULL,

 

name CHAR( 40 ) NOT NULL,

 

rep_key CHAR( 5 ) NOT NULL,

 

PRIMARY KEY ( cust_key )

 

)

 

CREATE TABLE RemoteCustomer(

 

cust_key CHAR( 12 ) NOT NULL,

 

name CHAR( 40 ) NOT NULL,

 

rep_key CHAR( 5 ) NOT NULL,

 

PRIMARY KEY ( cust_key )

 

)

 

Each of these tables has exactly the same columns and data types as the

 

Customer table itself. The only difference in their definition is that they do

 

not have a foreign key to the SalesRep table.

 

The conflict resolution procedure reports conflicts into a table named

 

ConflictLog , which has the following definition:

 

CREATE TABLE ConflictLog (

 

conflict_key numeric(5, 0) identity not null,

 

lost_name char(40) not null ,

 

won_name char(40) not null ,

 

primary key ( conflict_key )

 

)

 

The conflict resolution procedure is as follows:

168

Page 186
Image 186
Sybase DC38133-01-0902-01 manual first conflict resolution example, Two-table database is as follows, 168