Quoted identifiers

With Replication Server 15.2 and later, you can enable quoted identifier support for the DSI for object names such as table and column names that need to be enclosed in double quote characters to be parsed correctly because the object names:


Enabling quoted identifiers support

Use the create connection or alter connection commands to set the dsi_quoted_identifier parameter to “on” to enable quoted identifier support. See “Configuration parameters affecting individual connections”. See Chapter 3, “Replication Server Commands,” in the Replication Server Reference Manual for the create connection and alter connection full command syntax.

Data servers receive quoted identifiers differently. Adaptive Server and Microsoft SQL Server need a special connection set-up for quoted identifiers because they do not expect quoted identifiers. Oracle and UDB do not need a special connection to accept quoted identifiers.


System function to support quoted identifiers

The rs_set_quoted_identifier function string is added to set the DSI connection to Adaptive Server and Microsoft SQL Server. When dsi_quoted_identifier is set to “on”, the rs_set_quoted_identifier function string is sent to the replicate database as part of the connection configuration when the connection is established. Replication Server uses this function string to allow quoted identifiers to be sent through the connection.

See “rs_set_quoted_identifier,” in Chapter 4, “Replication Server System Functions” in the Replication Server Reference Manual and “Summary of system functions” on page 16 in the Replication Server Administration Guide Volume 2.


Marking identifiers as quoted

The create replication definition and alter replication definition commands are modified to allow you to mark identifiers as quoted identifiers using the quoted parameter.

When dsi_quoted_identifier is set to "on" for a replicate server connection and when dsi_quoted_identifier is subscribed to a replication definition that has identifiers marked as quoted identifiers, the marked identifiers are enclosed in double quotes.

When you set dsi_quoted_identifier to “on” and when an identifier is marked, the replicate servers that subscribed to the replication definition receive the marked identifier as a quoted identifier. If dsi_quoted_identifier is “off,” the markings are ignored and the identifier sent to the replicate server is not enclosed in double quotes.

Example

Example 1 To create a table foo with column foo_col1 as a quoted identifier:

create replication definition repdef
   with primary at primaryDS.primaryDB
   with all tables named “foo”
   (“foo_col1” int quoted, “foo_col2” int)
   primary key (“foo_col1”)

Example 2 To mark as quoted the table named foo: using a

alter replication definition repdef
   alter replicate table name “foo” quoted

Example 3 To unmark the column foo_col1:

alter replication definition repdef
   with replicate table name “foo”
   alter columns “foo_col1” not quoted

See “create replication definition” and “alter replication definition,” in Chapter 3, “Replication Server Commands,” in the Replication Server Reference Manual for the full command syntax.

NoteWhen replicating to a warm standby database and to replication definition subscribers, and the primary table name is marked as quoted but the replicate table name is not, or vice-versa, Replication Server sends both the primary table name and the replicate table name as quoted.


Mixed version restrictions

The quoted identifier feature is not supported in mixed version environments. For replication of a quoted identifier to succeed, the primary Replication Server and the Replication Server that connects to the replicate data server version must be 15.2. However, intermediate Replication Servers in a route can be of lower versions.