solidDB Help : Replication : Advanced Replication : Using Advanced Replication with applications : Building messages for synchronization : Beginning messages
  
Beginning messages
Before you start a synchronization message, make sure that any open transaction is committed or rolled back in the connection and that autocommit is turned off.
You must explicitly begin each synchronization message that is sent from a replica database to the master database with the MESSAGE BEGIN statement and specify a message name that is unique within the replica database, see MESSAGE BEGIN.
Note Use the optional TO clause if you want to send a message that contains the REGISTER REPLICA statement and are registering a replica database with a master database catalog other than the default catalog. For details on registration, see Registering replicas with the master database.
If you want to create and execute a synchronization message from a stored procedure, the following example shows how to create a synchronization message with a unique message name.
DECLARE Autoname VARCHAR;
DECLARE MsgBeginStr VARCHAR;
Autoname := GET_UNIQUE_STRING('MSG_');
MsgBeginStr := 'MESSAGE ' + autoname + ' BEGIN';
When you have composed the SQL statement as a string, you can execute it inside a stored procedure in one of two ways — either by using the EXECDIRECT feature, or by preparing and executing the SQL statement.
EXEC SQL EXECDIRECT MsgBeginStr;
or
EXEC SQL PREPARE cursor1 MsgBeginStr;
EXEC SQL EXECUTE cursor1;
EXEC SQL CLOSE cursor1;
EXEC SQL DROP cursor1;
Go up to
Building messages for synchronization