Mapping Oracle Data Types to EDM Types

The ODP.NET manifest file describes the primitive types, such as VARCHAR2 and Number, and the Entity Data Model (EDM) types, such as string and Int32, that they map to. It also includes the facets for each EDM type.

ODP.NET does not support Time literals and canonical functions related to the Time type.

Oracle considers both NULL and empty strings to be NULL strings and are considered to be equal. Operations, such as Equals(), Length(), and Trim() on such strings will result in a NULL string.

Table 4-1 maps the Oracle data types to their corresponding EDM types. The table also includes details about provider type attributes and the EDM type facets associated with each Oracle data type.

Table 4-1 Mapping of Oracle Data Types and EDM Types

Oracle Data Types EDM Types(Primitive-TypeKind) Provider Type Attributes: Name and Value EDM Type Facets

Bfile

Binary

  • Equal Comparable: False

  • Order Comparable: False

EDM Type Facets for Bfile

Binary_Double

Double

  • Equal Comparable: True

  • Order Comparable: True

Not Applicable

Binary_Float

Single

  • Equal Comparable: True

  • Order Comparable: True

Not Applicable

Binary_Integer

Int32

  • Equal Comparable: True

  • Order Comparable: True

Not Applicable

Blob

Binary

  • Equal Comparable: False

  • Order Comparable: False

EDM Type Facets for Blob

Char

String

  • Equal Comparable: True

  • Order Comparable: True

EDM Type Facets for Char

Clob

String

  • Equal Comparable: False

  • Order Comparable: False

EDM Type Facets for Clob

Date

DateTime

  • Equal Comparable: True

  • Order Comparable: True

EDM Type Facets for Date

Float

Decimal

  • Equal Comparable: True

  • Order Comparable: True

EDM Type Facets for Float

Int

Int32

  • Equal Comparable: True

  • Order Comparable: True

Not Applicable

Interval Day To Second

Decimal

  • Equal Comparable: True

  • Order Comparable: True

EDM Type Facets for Interval Day To Second

Interval Year To Month

Decimal

  • Equal Comparable: True

  • Order Comparable: True

EDM Type Facets for Interval Year To Month

Long

String

  • Equal Comparable: False

  • Order Comparable: False

EDM Type Facets for Long

Long Raw

Binary

  • Equal Comparable: False

  • Order Comparable: False

EDM Type Facets for Long Raw

NChar

String

  • Equal Comparable: True

  • Order Comparable: True

EDM Type Facets for NChar

NClob

String

  • Equal Comparable: False

  • Order Comparable: False

EDM Type Facets for NClob

Nested Table

 

Not Applicable

Not Applicable and Not Supported

Number(1,0)

Number(2,0)

Number(3,0)

Number(4,0)

Number(5,0)

Int16

  • Equal Comparable: True

  • Order Comparable: True

Not Applicable

Number(6,0)

Number(7,0)

Number(8,0)

Number(9,0)

Number(10,0)

Int32

  • Equal Comparable: True

  • Order Comparable: True

Not Applicable

Number(11,0)

Number(12,0)

Number(13,0)

Number(14,0)

Number(15,0)

Number(16,0)

Number(17,0)

Number(18,0)

Number(19,0)

Int64

  • Equal Comparable: True

  • Order Comparable: True

Not Applicable

Number

(all other cases)

Decimal

  • Equal Comparable: True

  • Order Comparable: True

EDM Type Facets for Number

NVarchar2

String

  • Equal Comparable: True

  • Order Comparable: True

EDM Type Facets for NVarchar2

Object

 

Not Applicable

Not Applicable and Not Supported

Raw

Binary

  • Equal Comparable: True

  • Order Comparable: True

EDM Type Facets for Raw

Raw(16)

Guid

  • Equal Comparable: True

  • Order Comparable: True

Not Applicable

Ref

 

Not Applicable

Not Applicable and Not Supported

ROWID

String

  • Equal Comparable: True

  • Order Comparable: True

EDM Type Facets for ROWID

Smallint

Int16

  • Equal Comparable: True

  • Order Comparable: True

Not Applicable

Timestamp

DateTime

  • Equal Comparable: True

  • Order Comparable: True

EDM Type Facets for Timestamp

Timestamp with

Local Time Zone

DateTime

  • Equal Comparable: True

  • Order Comparable: True

EDM Type Facets for Timestamp with Local Time Zone

Timestamp with

Time Zone

DateTimeOffset

  • Equal Comparable: True

  • Order Comparable: True

EDM Type Facets for Timestamp with Time Zone

UROWID

(size)

Binary

  • Equal Comparable: True

  • Order Comparable: True

EDM Type Facets for UROWID

Varchar2

String

  • Equal Comparable: True

  • Order Comparable: True

EDM Type Facets for Varchar2

VArray

 

Not Applicable

Not Applicable and Not Supported

XMLType

String

  • Equal Comparable: False

  • Order Comparable: False

EDM Type Facets for XMLType


EDM Type Facets

The following sections enumerate the EDM type facets for the preceding Oracle data types:

EDM Type Facets for Bfile 

Facet name Attribute name Value
MaxLength DefaultValue

Constant

2147483648

True

FixedLength DefaultValue

Constant

False

True


EDM Type Facets for Blob 

Facet name Attribute name Value
MaxLength DefaultValue

Constant

2147483648

True

FixedLength DefaultValue

Constant

False

True


EDM Type Facets for Char 

Facet name Attribute name Value
MaxLength Minimum

Maximum

DefaultValue

Constant

1

2000

2000

False

Unicode DefaultValue

Constant

False

True

FixedLength DefaultValue

Constant

True

True


EDM Type Facets for Clob 

Facet name Attribute name Value
MaxLength DefaultValue

Constant

2147483647

True

Unicode DefaultValue

Constant

False

True

FixedLength DefaultValue

Constant

False

True


EDM Type Facets for Date 

Facet name Attribute name Value
Precision Constant

DefaultValue

True

0


EDM Type Facets for Float 

Facet name Attribute name Value
Precision Minimum

Maximum

DefaultValue

Constant

0

126

0

False

Scale Minimum

Maximum

DefaultValue

Constant

0

38

0

False


EDM Type Facets for Interval Day To Second 

Facet name Attribute name Value
Precision Minimum

Maximum

DefaultValue

Constant

1

251

251

False

Scale Minimum

Maximum

DefaultValue

Constant

0

9

0

False


Note:

EDM types do not support TimeSpan.

Use Decimal to represent the total number of seconds. An application can obtain a TimeSpan by using the TimeSpan.FromSeconds static method.

EDM Type Facets for Interval Year To Month 

Facet name Attribute name Value
Precision Minimum

Maximum

DefaultValue

Constant

1

250

250

False

Scale Minimum

Maximum

DefaultValue

Constant

0

9

0

False


EDM Type Facets for Long 

Facet name Attribute name Value
MaxLength DefaultValue

Constant

2147483647

True

Unicode DefaultValue

Constant

False

True

FixedLength DefaultValue

Constant

False

True


EDM Type Facets for Long Raw 

Facet name Attribute name Value
MaxLength DefaultValue

Constant

2147483647

True

FixedLength DefaultValue

Constant

False

True


EDM Type Facets for NChar 

Facet name Attribute name Value
MaxLength Minimum

Maximum

DefaultValue

Constant

1

1000

1000

False

Unicode DefaultValue

Constant

True

True

FixedLength DefaultValue

Constant

True

True


Note:

For NChar, the actual data is subject to the maximum byte limit of 2000.

The value of 1000 for Maximum and DefaultValue allows the EDM wizard to display columns of NCHAR(1000), where 1000 is the maximum number of characters allowed in DDL.

EDM Type Facets for NClob 

Facet name Attribute name Value
MaxLength DefaultValue

Constant

2147483647

True

Unicode DefaultValue

Constant

True

True

FixedLength DefaultValue

Constant

False

True


EDM Type Facets for Number 

Facet name Attribute name Value
Precision Minimum

Maximum

DefaultValue

Constant

1

38

38

False

Scale Minimum

Maximum

DefaultValue

Constant

0

38

0

False


EDM Type Facets for NVarchar2 

Facet name Attribute name Value
MaxLength Minimum

Maximum

DefaultValue

Constant

1

2000

2000

False

Unicode DefaultValue

Constant

True

True

FixedLength DefaultValue

Constant

False

True


Note:

For NVARCHAR2, the actual data is subject to the maximum byte limit of 4000.

The value of 2000 for Maximum and DefaultValue allows the EDM wizard to display columns of NVARCHAR2(2000), where 2000 is the maximum number of characters allowed in DDL.

EDM Type Facets for Raw 

Facet name Attribute name Value
MaxLength Minimum

Maximum

Constant

1

2000

False

FixedLength DefaultValue

Constant

False

True


EDM Type Facets for ROWID 

Facet name Attribute name Value
MaxLength DefaultValue

Constant

18

True

Unicode DefaultValue

Constant

False

True

FixedLength DefaultValue

Constant

True

True


EDM Type Facets for Timestamp 

Facet name Attribute name Value
Precision Minimum

Maximum

DefaultValue

Constant

0

9

6

False


EDM Type Facets for Timestamp with Local Time Zone 

Facet name Attribute name Value
Precision Minimum

Maximum

DefaultValue

Constant

0

9

6

False


EDM Type Facets for Timestamp with Time Zone 

Facet name Attribute name Value
Precision Minimum

Maximum

DefaultValue

Constant

0

9

6

False


EDM Type Facets for UROWID 

Facet name Attribute name Value
MaxLength DefaultValue

Constant

4000

True

FixedLength DefaultValue

Constant

True

True


EDM Type Facets for Varchar2 

Facet name Attribute name Value
MaxLength Minimum

Maximum

DefaultValue

Constant

1

4000

4000

False

Unicode DefaultValue

Constant

False

True

FixedLength DefaultValue

Constant

False

True


EDM Type Facets for XMLType 

Facet name Attribute name Value
MaxLength DefaultValue

Constant

2147483647

True

Unicode DefaultValue

Constant

True

True

FixedLength DefaultValue

Constant

False

True