Use Declare Statements in Language Output Templates

To include declare statements, used to define local variables, in the language output templates, make sure that the batch configuration parameter is set to “off” for the Replication Server connected to the database.

When batch is set to “on”, the default for Adaptive Server, Replication Server can send multiple invocations of a function string to the data server as a single command batch, thereby putting multiple declarations of the same variable in that batch, which is unacceptable to Adaptive Server.

Performance is slower when batch mode is off because Replication Server must wait for a response to each command before the next one is sent. If your performance requirements are low, you can use declare statements in your function strings if you set batch to “off.” Alternatively, if you want to use batch mode for improved performance, create function-string language output templates that execute stored procedures, which can include declare statements and other commands.

See Replication Server Administration Guide Volume 1 > Manage Database Connections > Altering Database Connections > Set and Change Parameters Affecting Physical Connections > Configuration Parameters Affecting Physical Database Connections for more information about batch.