Show TOC

create function string classLocate this document in the navigation structure

Creates a function-string class.

Syntax
create function string class <function_class
	>[set parent to <parent_class>]
Parameters
function_class

The name of the function-string class to create. It must conform to the rules for identifiers. Function-string class names have a global name space, so they must be unique in the replication system.

set parent to

Designates a parent class for a new derived class.

parent_class

The name of an existing function-string class you designate as the parent class for a new derived class. rs_sqlserver_function_class cannot be used as a parent class.

Examples
Example 1

Creates a derived function-string class named <sqlserver_derived_class> that will inherit function strings from the system-provided class <rs_default_function_class>:

create function string class
 sqlserver_derived_class
 set parent to rs_default_function_class
Example 2

Creates a function-string class named <sqlserver2_function_class>. This class will be a base class, and will not inherit function strings. You can, however, specify this class as a parent class for a derived class:

create function string class sqlserver2_function_class
Usage
  • Use create function string class to create a function-string class. Function-string classes group function strings for a database. The function-string class, with its member function strings, is associated with a database. This association is made with the create connection or alter connection command.

  • The Replication Server to which create function string class is sent becomes the primary Replication Server for the newly-created function-string class.

  • Create a new derived class using the set parent to clause to specify a parent class from which the new class is to inherit function strings. Omit this clause to create a new base class, which does not inherit function strings from a parent class.

  • For an overview of function-string classes, function strings, and functions, see the Replication Server Administration Guide Volume 2.

  • Before you execute this command, make sure that the name for the new function-string class is unique in the replication system. Replication Server does not detect all name conflicts.

  • Replication Server distributes the new function-string class to qualifying sites through the replication system. The changes do not appear immediately at all such sites because of normal replication system lag time.

  • To modify function strings in the class <rs_sqlserver_function_class>, you must first select a Replication Server to be the primary site for the class. Then execute create function string class for <rs_sqlserver_function_class> at that site.

  • The Replication Server that serves as the primary site for any function-string class must have routes to all other Replication Servers where the class will be used.

  • The primary site for a derived class is the same as the primary site of its parent class. You must create a derived class at the primary site of its parent class. However, if the parent class is a system-provided class, <rs_default_function_class> or <rs_db2_function_class>, the primary site of the derived class is the Replication Server where you created the derived class.

System-Provided Function-String Classes

  • Replication Server provides three function-string classes that you can use:
    • <rs_sqlserver_function_class> – default generated Adaptive Server function strings are provided for this class. The default function strings in <rs_sqlserver_function_class> are identical to those in <rs_default_function_class>. This class is assigned by default to Adaptive Server databases you add to the replication system using rs_init. You can customize function strings for this class. <rs_sqlserver_function_class> cannot be used as a parent class or a derived class.

    • <rs_default_function_class> – default generated Adaptive Server function strings are provided for this class. The default function strings in <rs_sqlserver_function_class> are identical to those in <rs_default_function_class>. You cannot customize function strings for this class. This class can be used as a parent class but cannot become a derived class.

    • <rs_db2_function_class> – default generated DB2-specific function strings are provided for this class. Although this class is a derived class of <rs_default_function_class>, with customizations for DB2, you cannot customize function strings for this class. <rs_db2_function_class> can be used as a parent class but cannot be made a derived class.

Benefits of Function-String Inheritance

  • Using derived classes that inherit from system-provided classes <rs_default_function_class> or <rs_db2_function_class>, either directly or indirectly, allows you to customize only the function strings you want to customize and inherit all others, even for new table or function replication definitions.

    If you use classes that do not inherit from system-provided classes, you must create all function strings yourself, either in parent or derived classes, and add new function strings whenever you create a new table or function replication definition.

  • After an upgrade to a future release of Replication Server, derived classes that inherit from the system-provided classes <rs_default_function_class> or <rs_db2_function_class>, either directly or indirectly, will inherit function-string definitions for any new system functions.

Adding Function Strings to a Function-String Class

  • After you create a function-string class that does not inherit function strings from a parent class, add function strings for the system functions that have function-string-class scope. Then add function strings for system functions and user-defined functions that have replication definition scope and will be replicated to databases that use the new function-string class.

  • To create or customize function strings in a function-string class, use create function string. You cannot create function strings in the classes <rs_default_function_class> or <rs_db2_function_class>.

Permissions

create function string class requires “sa” permission.