Using 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.

Notebatch is set to “off” by default for non-ASE data servers.

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.

Refer to “Setting and changing parameters affecting physical connections” on page 176 in the Replication Server Administration Guide Volume 1 for more information about batch.