A Data Type Conversion

This appendix contains the following section:

Data Type Conversion

The gateway converts SQL Server data types to Oracle data types as follows:

Table A-1 Data Type Mapping and Restrictions

SQL Server Oracle Comment If Oracle uses large varchar (32k)

BIGINT

NUMBER(20)

   

BIGINT IDENTITY

NUMBER(20)

   

BINARY

RAW

-

 

BIT

NUMBER(3)

-

 

CHAR

CHAR

-

 

DATETIME

DATE

Fractional parts of a second are truncated

 

DECIMAL

NUMBER(p[,s])

-

 

DECIMAL IDENTITY

NUMBER(p[,s])

   

FLOAT

FLOAT(53)

-

 

IMAGE

LONG RAW

-

 

INT

NUMBER(10)

   

INT IDENTITY

NUMBER(10)

   

MONEY

NUMBER(19,4)

-

 

NCHAR

NCHAR

if the size is 1000 or less. If the size is more than 1000, then it will be mapped to LONG Oracle Database Character Set = Unicode, otherwise, it is not supported.

 

NTEXT

LONG

if Oracle DB Character Set = Unicode. Otherwise, it is not supported

 

NVARCHAR

NVARCHAR

-

 

NVARCHAR(MAX)

LONG

4000 < N

if Oracle DB Character Set = Unicode. Otherwise, it is not supported.

32767 < N

NUMERIC

NUMBER(p[,s])

-

 

NUMERIC IDENTITY

NUMBER(p[,s])

   

REAL

FLOAT(24)

-

 

SMALLDATETIME

DATE

-

 

SMALLMONEY

NUMBER(10,4)

-

 

SMALLINT

NUMBER(5)

-

 

SMALLINT IDENTITY

NUMBER(5)

   

SYSNAME

NVARCHAR

-

 

TEXT

LONG

   

TIMESTAMP

RAW

-

 

TINYINT

NUMBER(3)

-

 

TINYINT IDENTITY

NUMBER(3)

   

VARBINARY

RAW

1 < = N < = 2000

1 <= N <= 32767

VARBINARY(MAX)

LONG RAW

2000 < N

N < 32767

VARCHAR

VARCHAR2

N < = 4000

N <= 32767

VARCHAR(MAX)

LONG

4000 < N

32767 < N

XML

LONG

if Oracle Database Character Set = Unicode. Otherwise, it is not supported.