Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » MobiLink - Server Administration » MobiLink Data Mappings Between Remote and Consolidated Databases

MobiLink Data Mappings Between Remote and Consolidated Databases Next Page

Adaptive Server Enterprise data mapping


Note

Only supported data types are included here.

SQL Anywhere or UltraLite remote data types mapped to Adaptive Server Enterprise consolidated data types

The following table identifies how SQL Anywhere or UltraLite remote data types are mapped to Adaptive Server Enterprise consolidated data types. For example, a column of type FLOAT on the remote database should be type REAL on the consolidated database.

Maximum column length (MCL) depends on the Adaptive Server Enterprise page size. If the page size is 2K the MCL is 1954; if the page size is 4K the MCL is 4002. For information about MCL, see the Adaptive Server Enterprise documentation.

SQL Anywhere or UltraLite data type Adaptive Server Enterprise data type Notes

CHAR(n=<MCL)

VARCHAR(n)

CHAR(n>MCL)

TEXT

On download, ensure the values are not too long.

LONG NVARCHAR

UNITEXT

LONG VARCHAR

TEXT

NCHAR(c=<MCL)

UNIVARCHAR(c/2)

NCHAR(c>MCL)

UNITEXT

On download, ensure the values are not too long.

NTEXT

UNITEXT

NVARCHAR(c=<MCL)

UNIVARCHAR(c/2)

NVARCHAR(c>MCL)

UNITEXT

On download, ensure the values are not too long.

TEXT

TEXT

UNIQUEIDENTIFIERSTR

CHAR(36)

Do not use UNIQUEIDENTIFIERSTR. Use UNIQUEIDENTIFIER instead.

VARCHAR(n=<MCL)

VARCHAR(n)

VARCHAR(n>MCL)

TEXT

XML

TEXT

UNSIGNED BIGINT

NUMERIC(20)1 or UNSIGNED BIGINT2

BIGINT

NUMERIC(20)1 or BIGINT2

BIT

BIT

DECIMAL(p<39, s)

DECIMAL(p,s)

The precision of the Adaptive Server Enterprise NUMERIC can be from 1 to 38 digits (p<39).

DECIMAL(p>=39,s)

There is no corresponding data type in SQL Anywhere or UltraLite.

DOUBLE

DOUBLE PRECISION

FLOAT(p)

FLOAT(p)

UNSIGNED INTEGER

UNSIGNED INT

INTEGER

INTEGER

NUMERIC(p<39,s)

NUMERIC(p,s)

The precision of the Adaptive Server Enterprise decimal can be from 1 to 38 digits (p<39).

NUMERIC(p>=39,s)

REAL

REAL

UNSIGNED SMALLINT

UNSIGNED SMALLINT

SMALLINT

SMALLINT

UNSIGNED TINYINT

TINYINT

TINYINT

TINYINT

MONEY

MONEY

SMALLMONEY

SMALLMONEY

LONG VARBIT

TEXT

VARBIT(n=<MCL)

VARCHAR(n)

VARBIT(n>MCL)

TEXT

DATE

DATE3 or DATETIME4

For Adaptive Server Enterprise DATETIME, the year must be in the range 1753-9999.

For SQL Anywhere and UltraLite, the time value must in the format 00:00:00.

DATETIME

DATETIME

The Adaptive Server Enterprise DATETIME values are accurate to 1/300 second. The last digit of the fractional second is always 0, 3, or 6. Other digits will be rounded to one of these three digits, so 0 and 1 round to 0; 2, 3, and 4 round to 3; 5, 6, 7, and 8 round to 6; and 9 rounds to 10.

For download, SQL Anywhere keeps the original values from Adaptive Server Enterprise, but for upload, the values may not be exactly the original values.

If DATETIME is used for a primary key, conflict resolution may fail. In order to successfully synchronize DATETIME, you should round the fractional second to 10 milliseconds. Also, the year must be in the range 1753-9999.

SMALLDATETIME

DATETIME4

SQL Anywhere and UltraLite SMALLDATETIME is implemented as TIMESTAMP.

The Adaptive Server Enterprise DATETIME is accurate to the minute. 29.998 seconds or lower are rounded down to the nearest minute; values with 29.999 seconds or higher are rounded up to the nearest minute. SQL Anywhere or UltraLite SMALLDATETIME is accurate to the microsecond. In order to successfully synchronize, SQL Anywhere or UltraLite SMALLDATETIME must be rounded to the minute. Also, the year must be in the range 1753-9999.

TIME

TIME3 or DATETIME4

The Adaptive Server Enterprise TIME values are accurate to 1/300 second. The last digit of the fractional second is always 0, 3, or 6. Other digits will be rounded to one of these three digits, so 0 and 1 round to 0; 2, 3, and 4 round to 3; 5, 6, 7, and 8 round to 6; and 9 rounds to 10. For download, SQL Anywhere keeps the original values from Adaptive Server Enterprise, but for upload, the values may not be exactly the original values. If TIME is used for a primary key, conflict resolution may fail. In order to successfully synchronize TIME, you should round the fractional second to 10 milliseconds.

TIMESTAMP

DATETIME

The Adaptive Server Enterprise DATETIME values are accurate to 1/300 second. The last digit of the fractional second is always 0, 3, or 6. Other digits will be rounded to one of these three digits, so, 0 and 1 round to 0; 2, 3, and 4 round to 3; 5, 6, 7, and 8 round to 6; and 9 rounds to 10.

For download, SQL Anywhere keeps the original values from Adaptive Server Enterprise, but for upload, the values may not be exactly the original values.

If DATETIME is used for a primary key, conflict resolution may fail. In order to successfully synchronize DATETIME, you should round the fractional second to 10 milliseconds. Also, the year must be in the range 1753-9999.

BINARY(n=<MCL)

BINARY(n)

BINARY(n>MCL)

IMAGE

IMAGE

IMAGE

LONG BINARY

IMAGE

UNIQUEIDENTIFIER

CHAR(36)

VARBINARY(n=<MCL)

VARBINARY

VARBINARY(n>MCL)

IMAGE

1 Only applies to Adaptive Server Enterprise before version 15.0.

2 Only applies to Adaptive Server Enterprise version 15.0 and above.

3 Only applies to Adaptive Server Enterprise version 12.5.1 or above.

4 Only applies to Adaptive Server Enterprise before version 12.5.1.

Adaptive Server Enterprise consolidated data types mapped to SQL Anywhere or UltraLite remote data types

The following table identifies how Adaptive Server Enterprise consolidated data types are mapped to SQL Anywhere or UltraLite remote data types. For example, a column of type DOUBLE PRECISION on the consolidated database should be type DOUBLE on the remote database.

Adaptive Server Enterprise data typeSQL Anywhere or UltraLite data typeNotes

BIGINT1

BIGINT

INT

INT

SMALLINT

SMALLINT

TINYINT

TINYINT

UNSIGNED BIGINT1

UNSIGNED BIGINT

UNSIGNED INT1

UNSIGNED INT

UNSIGNED SMALLINT1

UNSIGNED SMALLINT

NUMERIC(p,s)

NUMERIC(p,s)

DECIMAL(p,s)

DECIMAL(p,s)

FLOAT(p)

FLOAT(p)

DOUBLE PRECISION

DOUBLE

REAL

REAL

SMALLMONEY

SMALLMONEY

MONEY

MONEY

SMALLDATETIME

SMALLDATETIME

SQL Anywhere and UltraLite SMALLDATETIME is implemented as TIMESTAMP.

The Adaptive Server Enterprise SMALLDATETIME is accurate to the minute. 29.998 seconds or lower are rounded down to the nearest minute; values with 29.999 seconds or higher are rounded up to the nearest minute. SQL Anywhere or UltraLite SMALLDATETIME is accurate to the microsecond. In order to successfully synchronize, SQL Anywhere or UltraLite SMALLDATETIME must be rounded to the minute. Also, the year must be in the range 1900-2078.

DATETIME

DATETIME

The Adaptive Server Enterprise DATETIME values are accurate to 1/300 second. The last digit of the fractional second is always one of 0, 3, or 6. Other digit numbers are rounded to one of these three digits, so 0 and 1 round to 0; 2, 3, and 4 round to 3; 5, 6, 7, and 8 round to 6; and 9 rounds to 10.

For download, SQL Anywhere keeps the original values from Adaptive Server Enterprise, but for upload, the values may not be exactly the original values. Conflict resolution may fail. In order to successfully synchronize DATETIME, you should round the fractional second to 10 milliseconds. Also, the year must be in the range 1753-9999.

DATE

DATE

For SQL Anywhere and UltraLite, the time value must in the format 00:00:00.

TIME

TIME

The Adaptive Server Enterprise TIME values are accurate to 1/300 second. The last digit of the fractional second is always one of 0, 3, or 6. Other digit numbers are rounded to one of these three digits, so 0 and 1 round to 0; 2, 3, and 4 round to 3; 5, 6, 7, and 8 round to 6; and 9 rounds to 10.

For download, SQL Anywhere keeps the original values from Adaptive Server Enterprise, but for upload, the values may not be exactly the original values. Conflict resolution may fail. In order to successfully synchronize TIME, it is recommended that you round the fractional second to 10 milliseconds.

CHAR(n)

VARCHAR(n)

There is no equivalence between SQL Anywhere CHAR/NCHAR and Adaptive Server Enterprise CHAR/NCHAR. SQL Anywhere CHAR/NCHAR is equivalent to VARCHAR/NVARCHAR. You should not use CHAR/NCHAR in a consolidated database column that is synchronized. If you must use non-SQL Anywhere CHAR/NCHAR, run the MobiLink server with the -b option.

VARCHAR(n)

VARCHAR(n)

UNICHAR(n)

NVARCHAR(n)

Not available in UltraLite.

UNIVARCHAR(n)

NVARCHAR(n)

Not available in UltraLite.

NCHAR(n)

VARCHAR(n)

The Adaptive Server Enterprise NCHAR and NVARCHAR store multibyte national character strings, they are different from SQL Anywhere NCHAR and NVARCHAR. In a multibyte environment, use SQL Anywhere or UltraLite VARCHAR.

NVARCHAR(n)

VARCHAR(n)

The Adaptive Server Enterprise NCHAR and NVARCHAR store multibyte national character strings, they are different from SQL Anywhere NCHAR and NVARCHAR. In a multibyte environment, use SQL Anywhere or UltraLite VARCHAR.

TEXT

LONG VARCHAR

UNITEXT1

LONG NVARCHAR

Not available in UltraLite.

BINARY(n)

BINARY(n)

VARBINARY(n)

VARBINARY(n)

IMAGE

LONG BINARY

BIT

BIT

1 Only applies to Adaptive Server Enterprise before version 15.0.