C# 与Oracle Data Type Mappings
2012-01-03 15:41
711 查看
The following table lists Oracle data types and their mappings to the OracleDataReader.
The following table lists Oracle data types and the .NET Framework data types (System.Data.DbType and OracleType) to use when binding them as parameters.
The InputOutput, Output, and ReturnValue ParameterDirection values used by the Value property of the OracleParameter object are .NET Framework data types, unless the input value is an Oracle data type (for example, OracleNumber or OracleString). This does not apply to REF CURSOR, BFILE, or LOB data types.
Oracle data type | .NET Framework data type returned by OracleDataReader.GetValue | OracleClient data type returned by OracleDataReader.GetOracleValue | Remarks |
---|---|---|---|
BFILE | Byte[] | OracleBFile | |
BLOB | Byte[] | OracleLob | |
CHAR | String | OracleString | |
CLOB | String | OracleLob | |
DATE | DateTime | OracleDateTime | |
FLOAT | Decimal | OracleNumber | This data type is an alias for the NUMBER data type, and is designed so that the OracleDataReaderreturns a System.Decimal or OracleNumber instead of a floating-point value. Using the .NET Framework data type can cause an overflow. |
INTEGER | Decimal | OracleNumber | This data type is an alias for the NUMBER(38) data type, and is designed so that theOracleDataReader returns a System.Decimal or OracleNumber instead of an integer value. Using the .NET Framework data type can cause an overflow. |
INTERVAL YEAR TO MONTH | Int32 | OracleMonthSpan | |
INTERVAL DAY TO SECOND | TimeSpan | OracleTimeSpan | |
LONG | String | OracleString | |
LONG RAW | Byte[] | OracleBinary | |
NCHAR | String | OracleString | |
NCLOB | String | OracleLob | |
NUMBER | Decimal | OracleNumber | Using the .NET Framework data type can cause an overflow. |
NVARCHAR2 | String | OracleString | |
RAW | Byte[] | OracleBinary | |
REF CURSOR | The Oracle REF CURSOR data type is not supported by the OracleDataReader object. | ||
ROWID | String | OracleString | |
TIMESTAMP | DateTime | OracleDateTime | |
TIMESTAMP WITH LOCAL TIME ZONE | DateTime | OracleDateTime | |
TIMESTAMP WITH TIME ZONE | DateTime | OracleDateTime | |
UNSIGNED INTEGER | Number | OracleNumber | This data type is an alias for the NUMBER(38) data type, and is designed so that theOracleDataReader returns a System.Decimal or OracleNumber instead of an unsigned integer value. Using the .NET Framework data type can cause an overflow. |
VARCHAR2 | String | OracleString |
Oracle data type | DbType enumeration to bind as a parameter | OracleType enumeration to bind as a parameter | Remarks |
---|---|---|---|
BFILE | BFile | Oracle only allows binding a BFILE as a BFILE parameter. The .NET Data Provider for Oracle does not automatically construct one for you if you attempt to bind a non-BFILE value, such as byte[] or OracleBinary. | |
BLOB | Blob | Oracle only allows binding a BLOB as a BLOB parameter. The .NET Data Provider for Oracle does not automatically construct one for you if you attempt to bind a non-BLOB value, such as byte[] or OracleBinary. | |
CHAR | AnsiStringFixedLength | Char | |
CLOB | Clob | Oracle only allows binding a CLOB as a CLOB parameter. The .NET Data Provider for Oracle does not automatically construct one for you if you attempt to bind a non-CLOB value, such as System.String or OracleString. | |
DATE | DateTime | DateTime | |
FLOAT | Single, Double, Decimal | Float, Double, Number | Size determines the System.Data.DBType and OracleType. |
INTEGER | SByte, Int16, Int32, Int64, Decimal | SByte, Int16, Int32, Number | Size determines the System.Data.DBType and OracleType. |
INTERVAL YEAR TO MONTH | Int32 | IntervalYearToMonth | OracleType is only available when using both Oracle 9i client and server software. |
INTERVAL DAY TO SECOND | Object | IntervalDayToSecond | OracleType is only available when using both Oracle 9i client and server software. |
LONG | AnsiString | LongVarChar | |
LONG RAW | Binary | LongRaw | |
NCHAR | StringFixedLength | NChar | |
NCLOB | NClob | Oracle only allows binding a NCLOB as a NCLOB parameter. The .NET Data Provider for Oracle does not automatically construct one for you if you attempt to bind a non-NCLOB value, such as System.String orOracleString. | |
NUMBER | VarNumeric | Number | |
NVARCHAR2 | String | NVarChar | |
RAW | Binary | Raw | |
REF CURSOR | Cursor | For more information, see Oracle REF CURSORs. | |
ROWID | AnsiString | Rowid | |
TIMESTAMP | DateTime | Timestamp | OracleType is only available when using both Oracle 9i client and server software. |
TIMESTAMP WITH LOCAL TIME ZONE | DateTime | TimestampLocal | OracleType is only available when using both Oracle 9i client and server software. |
TIMESTAMP WITH TIME ZONE | DateTime | TimestampWithTz | OracleType is only available when using both Oracle 9i client and server software. |
UNSIGNED INTEGER | Byte, UInt16, UInt32, UInt64, Decimal | Byte, UInt16, Uint32, Number | Size determines the System.Data.DBType and OracleType. |
VARCHAR2 | AnsiString | VarChar |
相关文章推荐
- MySql and Oracle Data Type Mappings
- C# 操作 XML 数据库类型、Oracle XMLType
- C# 获取ORACLE SYS.XMLTYPE "遇到不支持的 Oracle 数据类型 USERDEFINED"
- C# 使用System.Data.OleDb;避免oracle中文乱码问题
- How to tell RNA-seq library type of strand-specific for RNA-seq data (for reads mapping by Tophat)
- EF 6.0 The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value. c#中的时间
- Unsupported Oracle data type 101 encountered
- Delphi Data Type to C# Data Type
- Oracle 12C 新特性之扩展数据类型(extended data type)
- Managed Data Type Mappings (SQL Server Compact Edition)
- C#用Oracle.DataAccess中连接Oracle要注意版本问题!
- java stream jdbc docs(oracle datatype)
- Java Object to Data Model Data Type Mapping, java数据类型与数据库数据类型的对应
- 使用C# 连接不同版本的Oracle.DataAccess
- C#连接Oracle数据库(直接引用dll使用-Oracle.ManagedDataAccess.dll)
- Using Oracle Large Object (LOB) Datatype Columns In ODI Integration Interfaces [ID 423768.1]
- Oracle Data Type
- C# VS2010中,用微软自带的System.Data.OracleClient来连接Oracle数据库
- ASE ADO.NET datatype mappings
- org.springframework.data.mapping.model.MappingException: No id property found for object of type