Oracle to HANA DB

Lists Oracle-to-HANA DB datatype mappings.

See SAP HANA Reference > SQL Reference Manual > Data Types for current information on the range of values that can be represented by HANA DB datatypes.
Note: Do not use a column with the Oracle RAW or LONG RAW datatype as a primary key or as part of a primary key.
Oracle-to-HANA DB Datatype Mappings

Oracle Datatype

Replication Definition Datatype

HANA DB Datatype

ANYDATA

opaque

No default

BFILE

image

blob

BINARY_DOUBLE

rs_oracle_decimal

double

BINARY_FLOAT

rs_oracle_float

real

BLOB

image

blob

CHAR

char

char

(See note below.)

CLOB

text

unitext (multibyte)

clob

nclob (multibyte)

DATE

rs_oracle_datetime

timestamp

FLOAT

rs_oracle_float

float

INTEGER

rs_oracle_decimal

decimal (to 34 digits)

varchar (over 34 digits)

INTERVAL

rs_oracle_interval

No default

LONG

text

clob

LONG RAW

image

blob

NCHAR

unichar

nchar

NCLOB

unitext

nclob

NESTEDTAB

opaque

No default

NUMBER

rs_oracle_decimal

double
Note: When Oracle NUMBER is specified without precision, the maximum value allowed by the Oracle column exceeds HANA DB decimal. HANA DB double is the only HANA DB datatype supporting any possible Oracle value. When the NUMBER precision is known or specified, use HANA DB decimal.

NUMBER(1)

rs_oracle_decimal

tinyint

NUMBER(2)

NUMBER(4)

rs_oracle_decimal

smallint

NUMBER(5)

NUMBER(9)

rs_oracle_decimal

integer

NUMBER(10)

NUMBER(18)

rs_oracle_decimal

bigint

NUMBER(p,s)

rs_oracle_decimal

varchar

decimal (to 34 digits)

varchar (over 34 digits)

NVARCHAR

univarchar

nvarchar

NVARCHAR2

univarchar

nvarchar

Object types

opaque

No default

RAW

rs_oracle_binary (up to 255 bytes)

varbinary (greater than 255 bytes)

varbinary

REF

rs_oracle_binary

No default

ROWID

rs_oracle_rowid

varchar(20)

TIMESTAMP(n)

rs_oracle_timestamp9

timestamp

TIMESTAMP WITH LOCAL TIME ZONE

rs_oracle_timestamp9

No default

TIMESTAMP WITH TIME ZONE

rs_oracle_timestamptz

No default

VARCHAR2

varchar

varchar

(See note below.)

VARRAY

opaque

No default

Note: If your primary database is configured for a single-byte character set (like iso_1) that accepts extended ASCII characters—the one-byte ASCII character values between 128 and 255—HANA DB may convert single-byte extended characters into double-byte characters in char or varchar columns. This conversion may subsequently cause the storage size in HANA DB to exceed the original column length or storage of the primary database. If your primary database and application support using extended ASCII characters in a single-byte character set, you may need to increase the size of the corresponding column in the HANA DB table definition. This change allows those columns to accommodate the conversion of extended characters to two-byte storage.

Fixed-Length Column Mapping

HANA DB does not pad fixed-length CHAR column values specified in a subscription where clause, and this can result in a data mismatch. For example, if the character string 'abc' is passed in a fixed-length column defined in a subscription where clause as char(5), HANA DB does not pad the remaining characters with whitespace as 'abc  ', and a mismatch occurs. You should therefore map fixed-length CHAR columns to the HANA DB varchar datatype.