Restoring default function strings

To restore the Adaptive Server default function string for a system function with replication definition scope, omit the output clause in the create function string or alter function string command. You cannot omit an output template from a system function with function-string-class scope, although you can specify an empty template.

Refer to Chapter 3, “Replication Server Commands” of the Replication Server Reference Manual, for more information on these commands.

In all classes, even derived classes, executing the create function string or alter function string command without the output clause restores the same function string that is provided by default for the system-provided classes rs_sqlserver_function_class and rs_default_function_class.

The default function-string definition this method yields may or may not be appropriate for the databases to which you have assigned the class. This method may be most helpful when you are using a customized rs_sqlserver_function_class or when you are using other user-created base classes for Adaptive Server databases.

In a derived class, if you want to discard a customized function string and restore the function string from the parent class, drop the function string. See “Dropping function strings” for details.

Example for alter function string

The following command replaces a customized rs_insert function string for the publishers_rep replication definition with the default function string:

alter function string publishers_rep.rs_insert
for rs_sqlserver_function_class

See “Altering function strings” for details on using the alter function string command.

Example for create function string in a derived class

You can use this method in a derived function-string class to override an inherited function string with the Adaptive Server default function string. The following command replaces an inherited rs_insert function string for the publishers_rep replication definition with the default function string:

create function string publishers_rep.rs_insert
for derived_class

See “Creating function strings” for details on using the create function string command.