Show TOC

alter request function replication definitionLocate this document in the navigation structure

Changes the function replication definition created by the create request function replication definition command.

Syntax
alter request function replication definition <repdef_name>
        {with replicate function named ‘<func_name>’ |
        add @<param_name> <datatype>[, @<param_name> <datatype>]… |
        add searchable parameters @<param_name>[, @<param_name>]… |
        send standby {all | replication definition} parameters}
         [with DSI_suspended]
Parameters
repdef_name

The name of the request function replication definition to change.

with replicate function named 'func_name'

Specifies the name of the stored procedure to execute at the replicate database. The replicate function name of this replication definition must be different from its primary function name. <func_name> is a character string with a maximum length of 255 characters.

add

Specifies additional parameters and their datatypes for the function replication definition.

@param_name

The name of the parameter that you want to add to the list of replicated or searchable parameters. Each parameter name must begin with the @ character.

datatype

The datatype of the parameter you want to add to a parameter list. Adaptive Server stored procedures and function replication definitions cannot contain parameters with the <text>, <unitext>, <rawobject>, and <image> datatypes.

add searchable parameters

Specifies additional parameters that you can use in the where clause of the create subscription or define subscription command.

send standby

In a warm standby application, specifies whether to send all parameters in the function (send standby all parameters) or only those specified in the replication definition (send standby replication definition parameters), to a standby database. The default is send standby all parameters.

with DSI_suspended

Allows you to suspend the standby DSI, if there is one, and each of the subscribing replicate DSI threads. Replication Server suspends the DSI thread in the standby or replicate database after Replication Server applies all the data for the old replication definition version to the standby or replicate database.

After Replication Server suspends a DSI thread, you can make changes to target stored procedures, and to any customized function strings. When you resume the DSI thread, Replication Server replicates the primary updates using the altered replication definition.

You do not need to use with DSI_suspended if:

  • There is no subscription to the replication definition.

  • You do not need to change customized function strings.

  • You do not need to change the replicate or standby database stored procedure.

Note

If there is a subscription from a replicate Replication Server with a site version earlier than 1550, the replicate DSI threads for that Replication Server are not suspended.

Examples
Example 1
Adds <@notes>, <@pubdate>, and <@contract> parameters to the titles_frep function replication definition:
alter request function replication definition 
    titles_frep
add @notes varchar(200), @pubdate datetime,
    @contract bit
Example 2
Adds the <@type> and <@pubdate> parameters to the list of searchable parameters in the titles_frep function replication definition:
alter request function replication definition
    titles_frep
add searchable parameters @type, @pubdate
Example 3
Changes the titles_frep function replication definition to be replicated as the newtitles stored procedure at the replicate database, and instructs Replication Server to suspend the target DSI after primary data that exists before you execute alter request replication definition is replicated to the replicate database:
alter request function replication definition titles_frep
with replicate function named ‘newtitles’
with DSI suspended
Usage
  • Use alter request function replication definition to change an existing request function replication definition. You can add replicated and searchable parameters, select which parameters to send to the warm standby, and specify a different name for the stored procedure to execute at the replicate database.

  • alter request function replication definition can alter only the replication definition created with the create request function replication definition command.

  • When you change a function replication definition, the name, parameters, and datatypes that you specify for the function replication definition must match the stored procedure that you are replicating. Only the parameters specified in the function replication definition are replicated.

  • Multiple function replication definitions for the same stored procedure must have the same parameter list. If you add a new parameter, the new parameter is automatically added to all the function replication definitions created for that stored procedure.

  • You must execute the alter request function replication definition command at the primary Replication Server where you created the function replication definition.

  • A parameter name cannot appear more than once in any clause.

  • When adding parameters, you must instruct Replication Server to coordinate alter request function replication definition with distributions for the function replication definition. In addition, you must instruct Replication Server to coordinate changes to stored procedures and replicatim definitions.

    See Replication Server Administration Guide Volume 1 > Managing Replicated Tables > Replication Definition Change Request Process to alter replication definitions.

  • Use the with replicate function named clause to specify the stored procedure name you want to execute at the replicate database. See create request function replication definition.

For more information about altering a request function replication definition, see the Replication Server Administration Guide Volume 1.

Permissions

alter request function replication definition requires “create object” permission.