Datatype compatibility

Replication Agent for Oracle processes Oracle transactions and passes data to the primary Replication Server. In turn, the primary Replication Server uses the datatype formats specified in the replication definition to receive the data from Replication Agent for Oracle.

Table 2-2 describes the conversion of Oracle datatypes to Sybase datatypes.

Table 2-2: Recommended Oracle datatype mapping

Oracle datatype

Oracle length/range

Sybase datatype

Sybase length/range

Notes

BINARY_FLOAT

5 bytes, 32-bit single precision floating point number datatype

rs_oracle_float

4 or 8 bytes, depending on precision

  • Maximum positive finite value is 3.40282E+38F.

  • Minimum positive finite value is 1.17549E-38F.

BINARY_DOUBLE

9 bytes, 64-bit single precision floating point number datatype

double

8 bytes

  • Maximum positive finite value is 1.79769313486231E+308.

  • Minimum positive finite value is 2.22507485850720-308.

CHAR

255 bytes

char

32K

DATE

8 bytes, fixed-length

datetime or rs_oracle_datetime

8 bytes

Replication Server supports dates from January 1, 1753 to December 31, 9999.

Oracle supports dates from January 1, 4712 BC to December 31, 9999 AD.

If pdb_convert_datetime is true, the Sybase datatype used should be datetime. The value replicated is YYYYMMDD HH:MM:SS.sss. If pdb_convert_datetime is false, the Sybase datatype used should be rs_oracle_datetime. The format replicated is MM/DD/YYYY HH:MI:SS.

TIMESTAMP(n)

21-31 bytes, variable-length

datetime or rs_oracle_timestamp9

8 bytes

Replication Server supports dates from January 1, 1753 to December 31, 9999.

Oracle supports dates from January 1, 4712 BC to December 31, 4712 AD.

If pdb_convert_datetime is true, the Sybase datatype used should be datetime. If pdb_convert_datetime is false, the Sybase datatype used should be rs_oracle_timestamp9.

TIMESTAMP(n) WITH [LOCAL] TIME ZONE

Variable-length

rs_oracle_timestamptz

INTERVAL YEAR(n) TO MONTH

Variable-length

rs_oracle_interval

INTERVAL DAY(n) TO SECOND(n)

Variable-length

rs_oracle_interval

LONG

2GB, variable-length character data

text

LONG RAW

2GB, variable-length binary data

image

BLOB

4GB, variable-length binary large object

image

2GB

CLOB

4GB, variable-length character large object

text

2GB

NCHAR

255 bytes, multi-byte characters

unichar or char

32K

NCLOB

4GB, variable-length multibyte character large object

unitext or text

2GB

For Replication Server 15.0 and later versions, the NCLOB datatype maps to unitext. For earlier versions of Replication Server, the NCLOB datatype maps to image.

NVARCHAR2

2000 bytes, variable-length, multibyte character data

univarchar or varchar

32K

BFILE

4GB, locator points to large binary file

image

2GB

MLSLABEL

5 bytes, variable-length binary OS label

Not supported.

NUMBER (p,s)

21 bytes, variable-length numeric data

float, int, real, number, decimal, or rs_oracle_decimal

float is 4 or 8 bytes. int is 4 bytes. real is 4 bytes. number and decimal are 2 to 17 bytes.

The float datatype can convert to scientific notation if the range is exceeded.

Integers (int) are truncated if they exceed the Replication Server range of 2,147,483,647 to -2,147,483,648 or 1x10-130 to 9.99x1025.

The number and decimal datatypes are truncated if they exceed the range of -1038 to 1038-1.

Oracle precision ranges from 1 to 38 digits. Default precision is 18 digits.

Oracle scale ranges from -84 to 127. Default scale is 0.

RAW

2000 bytes, variable-length binary data

rs_oracle_binary

32K

ROWID

6 bytes, binary data representing row addresses

rs_oracle_rowid

32K

SIMPLE_INTEGER

4 bytes representing signed integers

integer

SIMPLE_INTEGER is an extension of the Oracle PLS_INTEGER datatype. Both are only for use with PL/SQL. The SIMPLE_INTEGER datatype is new as of Oracle 11g.

UDD object type

Variable length character data

rs_rs_char_raw

32K

See “Oracle user-defined types”.

VARCHAR2

2000 bytes, variable-length character data

varchar

32K