Data Types
- Last Updated: April 16, 2026
- 4 minute read
- ADO.NET
- Documentation
The following table list the data types supported by the Oracle data provider:
- Mapping Oracle Data Types maps the Oracle data types to the .NET Framework types.
- Mapping System.Data.DbTypes to OracleDbType Enumerations maps the data types the data provider uses if only the System.Data.DbType is specified.
- Mapping .NET Framework Data Types to OracleDbTypes maps the data types the data provider uses to infer a data type if the provider-specific type and the System.Data.DbType are not provided.
- Supported Stream Objects maps the data types the data provider uses when streams are used as inputs to Long data parameters.
Mapping Oracle Data Types to .NET Framework Data Types
The following table lists the data types supported by the Oracle data provider and how they are mapped to the .NET Framework types. You can use the table to infer the data types that will be used when a DataSet is filled using a DataAdapter. This table also identifies the accessors to use for accessing the data when a DataReader object is used directly.
In this table, the columns are defined as follows:
- The Oracle Data Type column refers to the native type name.
- The OracleDbType column refers to the Oracle data provider’s type enumeration. Generally, there is a one to one mapping between the native type and the OracleDbType.
- The .NET Framework Type column refers to the base data types available in the framework.
- The .NET Framework Typed Accessor column refers the method that must be used to access a column of this type when using a DataReader.
Mapping Oracle Data Types
| Oracle Data Type | OracleDbType | .NET Framework Type | .NET Framework Typed Accessor |
| BFILE | Bfile | Byte[] | GetBytes( ) |
| BINARY_DOUBLE1 | Double | Double | GetDouble( ) |
| BINARY_FLOAT1 | Float | Single | GetDecimal( ) |
| BLOB | Blob | Byte[] | GetBytes( ) |
| CHAR | Char | String Char[] |
GetString( ) GetChars( ) |
| CLOB | Clob | String Char[] |
GetString( ) GetChars( ) |
| DATE | Date | DateTime | GetDateTime() |
| LONG2 |
Long | String Char[] |
GetString( ) GetChars( ) |
| LONG RAW2 | LongRaw | Byte[] | GetBytes( ) |
| NCHAR | NChar | String Char[] |
GetString( ) GetChars( ) |
| NCLOB | NClob | String Char[] |
GetString( ) GetChars( ) |
| NUMBER | Number | Decimal | GetDecimal( ) |
| NVARCHAR2 | NVarChar | String Char[] |
GetString( ) GetChars( ) |
| RAW | Raw | Byte[] | GetBytes( ) |
| ROWID | RowId | String Char[] |
GetString( ) GetChars( ) |
| TIMESTAMP3 | Timestamp | DateTime | GetDateTime() |
| TIMESTAMP WITH LOCAL TIME ZONE3 |
TimestampLocal | DateTime | GetDateTime() |
| TIMESTAMP WITH TIME ZONE | TimestampWithTZ | DateTime | GetString( ) GetChars( ) |
| VARCHAR2 | VarChar | String Char[] |
GetString( ) GetChars( ) |
| XmlType3 |
XmlType | String[] Char[] |
GetChars() GetString() GetValue() GetValues() GetXmlReader() |
1 Only supported on Oracle 10g and higher.
2 The Oracle documentation strongly discourages the use of the Long and Long Raw data types.
3 Only supported on Oracle 9i and higher.
Mapping Parameter Data Types
The type of the parameter is specific to each data provider. The Oracle data provider must convert the parameter value to a native format before sending it to the server. The best way for an application to describe a parameter is to use the data provider-specific type enumeration.
In generic programming circumstances, the data provider-specific type may not be available. When no provider-specific DbType has been specified, the data type will be inferred from either the System.Data.DbType or from the .NET Framework type of the parameter’s value.
The Oracle data provider uses the following order when inferring the data type of a parameter:
- The data provider uses the provider-specific data type if it has been specified.
- The data provider infers the data type from the System.Data.DbType if it has been specified, but the provider-specific data type has not been specified.
- The data provider infers the data type from the .NET Framework type if the provider-specific data type and the System.Data.DbType have not been specified.
The following table shows how Oracle infers its types if only the System.Data.DbType is specified.
Mapping System.Data.DbTypes to OracleDbType Enumerations
| System.Data.DbType | OracleDbType Enumerations |
| Object | BFile |
| Object | Blob |
| Byte | Byte |
| AnsiStringFixedLength | Char |
| Object | Clob |
| Date | Date or Timestamp1 |
| DateTime | Date or Timestamp1 |
| Time | Date or Timestamp1 |
| Double | Double |
| Single | Float |
| Int16 | Int16 |
| Int32 | Int32 |
| Int64 | Int64 |
| String | Long |
| Binary | LongRaw |
| StringFixedLength | NChar |
| Object | NClob |
| GUID | Not supported |
| Object | Not supported |
| Boolean | Number |
| Currency | Number |
| Decimal | Number |
| VarNumeric | Number |
| String | NVarChar or XmlType |
| Binary | Raw |
| — | RowId |
| Sbyte | Sbyte |
| DateTime | Timestamp |
| DateTime | TimestampLocal |
| DateTime | TimestampWithTZ |
| Uint16 | Uint16 |
| Uint32 | Uint32 |
| Uint64 | Uint64 |
| AnsiString | VarChar |
| XML | XmlType |
1 Maps to Date for Oracle 8i.
The following table shows the mapping that the data provider uses to infer a data type if neither the provider-specific data type nor the System.Data.DbType are provided.
Mapping .NET Framework Data Types to OracleDbTypes
| .NET Framework Type | OracleDbType |
| Boolean | Number |
| Byte | Byte |
| Byte[] | Raw1 |
| Char | Not supported |
| DateTime | Date |
| Decimal | Number |
| Double | Double |
| GUID | Not supported |
| Int16 | Int16 |
| Int32 | Int32 |
| Int64 | Int64 |
| Object | Not supported |
| Sbyte | Sbyte |
| Single | Float |
| String | VarChar2 |
| Uint16 | Uint16 |
| Uint32 | Uint32 |
| Uint64 | Uint64 |
1 Byte array size must be less than 4000. For byte arrays greater than 4000, explicitly set the OracleDbType.
2 Strings greater than 4000 characters are not allowed. For Strings greater than 4000 characters, explicitly set the OracleDbType.
Data Types Supported With Stream Objects
The following table shows the data types with which the Oracle data provider supports the use of streams as inputs to long data parameters.
Supported Stream Objects
| Provider Data Type | Stream Type Supported |
| BLOB | Stream |
| CLOB | TextReader |
| NCLOB | TextReader |
| XmlType | TextReader |
See Using Streams as Input to Long Data Parameters for a discussion of using streams.