My previous posts provided an introduction to SAP Sybase Replication Server and how it fits into heterogeneous replication systems. In this post, I would like to begin discussing specific customization and problem solving techniques that can be very useful in many data replication scenarios for both heterogeneous and non-heterogeneous systems through the internal use of SAP Sybase Replication Server function strings.
Functions strings customization allows you to change default behavior when applying commands to a replicate database, a couple of typical use cases could be:
Customization is especially interesting in heterogeneous replication because you can use specific DBMS syntax to bulid your commands.
Concepts
Function strings can be defined as templates internally used by SAP Sybase Replication Server to generate the syntax used when applying changes at each replicate database. When talking about function strings we have to define three important concepts:
By default, Replication Server has system functions for common dataserver actions. In case of rs_insert, rs_delete and rs_update, they are internally generated with the default behavior for each replication definition you create. For example, these are default rs_insert, rs_delete and rs_update function strings created for a table called test that has two columns (id int and c char):
- rs_insert:
insert test (id, c) values (?id!new?, ?c!new?)
- rs_update:
update test set id=?id!new?, c=?c!new? where id=?id!old?
- rs_delete:
delete from test where id=?id!old?
How Replication Server uses functions and function strings
The following diagram shows how function and function strings internally work:

Customization
Replication Server includes commands to create new function string clases, create function strings, alter function strings, etc. For example, function strings can be customized to:
The following how-to-video shows how you can change default function string behavior with an interesting use case:
Note: set video resolution to HD
Knowing how function strings work in SAP Sybase Replication Server and how you can customize behavior, you can go further and think about Replication Server in terms of database event capture and change default behavior when applying changes to replicate database, or further, be able to run any specific replicate DBMS command or stored procedure.
More details in SAP Sybase documentation:
Other/Related Posts: