zoukankan      html  css  js  c++  java
  • C# 与Oracle Data Type Mappings

    The following table lists Oracle data types and their mappings to the OracleDataReader.

    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

     

    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.

    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

     

    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.

  • 相关阅读:
    如何查看linux系统是32位还是64位
    netstat 的10个基本用法
    linux入门教程(十) 文档的压缩与打包
    linux入门教程(九) 文本编辑工具vim
    linux入门教程(八) Linux磁盘管理
    linux入门教程(七) linux系统用户以及用户组管理
    CentOS5下配置JDK1.6+TOMCAT6
    【Nodejs】外研社一年级起各年级英语音频下载(缺456年级上)
    【Nodejs】外研社一年级起三年级下MP3下载爬虫1.00
    【Python】torrentParser1.03
  • 原文地址:https://www.cnblogs.com/itelite/p/2311030.html
Copyright © 2011-2022 走看看