Show TOC

create error classLocate this document in the navigation structure

Creates an error class.

Syntax
create [replication server] error class <error_class>
    [set template to <template_error_class>]
Parameters
replication server

Indicates that the new error class is a Replication Server error class and not a data server error class.

error_class

The name for the new error class. The name must be unique in the replication system and must conform to the rules for identifiers.

Note

A Replication Server error class and a data server error class cannot share the same name.

set template to template_error_class

Use this clause to create an error class based on another error class. create error class copies the error actions from the template error class to the new error class.

Examples
Example 1

This example creates a new error class named <pubs2_db_err_class>:

create error class pubs2_db_err_class
Example 2
Creates the my_error_class error class based on rs_oracle_error_class:
create error class my_error_class set template to rs_oracle_error_class
Example 3
Creates a new Replication Server error class named pubs2_rs_err_class:
create replication server error class
   pubs2_rs_err_class
Example 4
Creates the my_rs_err_class Replication Server error class based on rs_repserver_error_class, which is the default Replication Server error class:
create replication server error class my_rs_err_class
set template to rs_repserver_error_class
Usage
  • Use create error class to create an error class. An error class is a name used to group error action assignments for a database.

  • This command has the following requirements:
    • Routes must exist from the Replication Server where an error class is created to the Replication Servers managing data servers that are to use the error class.

    • The <rs_sqlserver_error_class> is the default error class provided for Adaptive Server databases while the <rs_repserver_error_class> is the default error class provided for Replication Server. Initially, these two error classes do not have a primary site. You must create these error classes at a primary site before you can change the default error actions.

    • After using create error class, use the rs_init_erroractions stored procedure to initialize the error class.

  • Associate an error class with a database using create connection or alter connection. Each database can have one error class. An error class can be associated with multiple databases.

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

Assigning Error Actions

  • Use assign action to change the Replication Server response to specific data server errors. Actions are assigned at the Replication Server where the error class is created.

Dropping Error Classes

  • Use drop error class to remove an error class and any actions associated with it.

Non-Adaptive Server Error Classes

  • You can assign non-Adaptive Server error classes to specific connections on non-Adaptive Server replication databases using the create connection and alter connection commands.

  • When Replication Server establishes a connection to a non-ASE replicate server, Replication Server verifies if the option to return native error codes from the non-ASE replicate server is enabled for the connection. If the option is not enabled, Replication Server logs a warning message that the connection works but error action mapping may not be correct.

    See “ReturnNativeError,” in the Replication Server Options documentation to set the option in the Enterprise Connect™ Data Access (ECDA) Option for ODBC for your replicate server.

  • For a list of non-Adaptive Server error classes, see Error and Function Classes table. For more information about non-Adaptive Server replication error classes, see the Replication Server Administration Guide Volume 1.

Permissions

create error class requires “sa” permission.