User-defined datatypes - connect_cdc_mimix_share - Latest

Connect CDC System Reference Guide

Product type
Software
Portfolio
Integrate
Product family
Connect
Product
Connect > Connect CDC (MIMIX Share)
Version
Latest
Language
English
Product name
Connect CDC
Title
Connect CDC System Reference Guide
Copyright
2024
First publish date
2003
Last edition
2024-08-20
Last publish date
2024-08-20T21:40:14.000381

There are cases where Connect CDC discovers new datatypes at runtime, for example, user-defined datatypes in MS SQL Server (see User-defined datatypes) and Sybase.

If such datatypes are used, they must be defined at all instances of the DBMS. For example, you cannot have two Sybase instances that have different lists of user-defined datatypes.

Datatypes discovered at runtime are assumed to be compatible with any other datatype. The Connect CDC Director does not prevent you from mapping a user-defined datatype to any datatype supported by Connect CDC. If datatypes are in fact incompatible, you will receive runtime errors. Table registration and data distribution may fail.

To distribute a column that has a user-defined datatype, define the same datatype in the Connect CDC metabase database (omnirep), exactly as it is in the original database. Do this before you register the table in the Connect CDC Director.

If a user-defined datatype is not defined in the metabase, when a request is started and the XML metadata loaded, Connect CDC Kernel fails to populate the SQL metabase.

Before a table can use a new UDT, you must define it in the user and the Connect CDC metabase with a tool such as the MS SQL Server Query Analyzer using sp_addtype. See the following sample commands:
EXEC sp_addType UDTNUM42, "numeric(4,2)";
EXEC sp_addType UDTVC20, "varchar(20)";
EXEC sp_addType UDTVC30, "varchar(30)";
EXEC sp_addType UDTINT, "int";
See the following example where a table is created using user-defined datatypes (UDTs).
create table qatest.dbo.UDT (
  key1 int primary key,
  col1 varchar(20),
  col2 udtvc20,
  col3 udtvc30,
  col4 udtnum42,
  col5 udtint);

Executing these commands would result in the creation of the following datatypes:   

 

These datatypes display in the Datatypes column on the Table Properties dialog box, Mapping Tab, as the following example shows:

 

Similarly, they are displayed on the Table Properties dialog box, Column Tab, just as system-defined datatypes would be.