The execute subcommand is used to send a replicated function or stored procedure call to another Replication Server. This subcommand is used with the preferred method for distributing stored procedures—applied and request functions—and with the older method—request stored procedures.
This is the syntax for the execute subcommand:
distribute command_tags execute {[repfunc] function | [replication_definition.]function | sys_sp stored_procedure} [param_list]
The repfunc keyword (available only with LTL version 103 or later) indicates that the function name that follows is a user-defined function associated with a function replication definition. When you create a function replication definition for a replicated stored procedure, a user-defined function with the same name is created for you. In this case, the execute subcommand does not include the function replication definition name.
For applied functions, Replication Server distributes the execute repfunc subcommand from a primary Replication Server to any replicate Replication Servers with subscriptions for the associated function replication definition.
For request functions, Replication Server distributes the execute repfunc subcommand from a replicate Replication Server to the primary Replication Server for the function replication definition.
When the repfunc keyword is omitted, the function name that follows is a user-defined function associated with a table replication definition, and replication_definition is the name of the replication definition. Refer to the Replication Server Administration Guide Volume 2 for a detailed description of user-defined functions.
Without the repfunc keyword, the execute subcommand is used only for request stored procedures associated with table replication definitions. (Applied stored procedures associated with table replication definitions use the applied subcommand.) Replication Server distributes the execute subcommand from a replicate Replication Server to the primary Replication Server for the table replication definition.
If the execute subcommand does not specify a replication definition, Replication Server searches its system tables for the function name and then finds the associated table replication definition. If the function name is not unique, and the replication definition is not specified, an error message reports that the function name is valid for more than one replication definition.
function is the name of both the user-defined function and the replicated stored procedure. When Replication Server receives the execute command, it maps the function name to a user-defined function previously created by either the create function replication definition command or the create function command.
With LTL version 200 or later, RepAgent uses sys_sp to send system stored procedures to the standby database.
param_list is a list of the data values supplied when the procedure was executed. You must enclose parameter values in parentheses.
See the Replication Server Reference Manual for more information about the create function replication definition and create function commands. Also see the Replication Server Administration Guide Volume 2 for more information about replicated functions and stored procedures.