ODP.NET Types Overview

本文介绍了ODP.NET中用于表示Oracle本地数据类型和PL/SQL数据类型的结构和类。通过对比.NET Framework的数据类型,展示了ODP.NET类型如何提供更安全且高效的方式来处理Oracle数据。

ODP.NET Types Overview

ODP.NET types represent Oracle native data types and PL/SQL data types as a structure or as a class. ODP.NET type structures follow value semantics, while ODP.NET type classes follow reference semantics. ODP.NET types provide safer and more efficient ways of obtaining Oracle native data and PL/SQL data types in a .NET application than .NET types. For example, an OracleDecimal structure holds up to 38 digits of precision, while a .NET Decimal only holds up to 28.

Table 3-9 lists data types supported by ODP.NET and their corresponding ODP.NET types: data types in the first column refer to both Oracle native data types and PL/SQL data types of that name. Those data types that exist only in PL/SQL are indicated by (PL/SQL only) after the data type name. The entries for the PL/SQL data types also represent the subtypes of the data types, if any. The third column lists the .NET Framework data type that corresponds to the Value property of each ODP.NET type.

Table 3-9 Value Property Type of ODP.NET Type

Oracle Native Data Type or PL/SQL Data TypeODP.NET Type.NET Framework Data Types

BFILE

OracleBFile class

System.Byte[]

BINARY_DOUBLE

OracleDecimal structure

System.Decimal

BINARY_FLOAT

OracleDecimal structure

System.Decimal

BINARY_INTEGER (PL/SQL only)

OracleDecimal structure

System.Decimal

BLOB

OracleBlob class

System.Byte[]

CHAR

OracleString structure

System.String

CLOB

OracleClob class

System.String

DATE

OracleDate structure

System.DateTime

INTERVAL DAY TO SECOND

OracleIntervalDS structure

System.TimeSpan

INTERVAL YEAR TO MONTH

OracleIntervalYM structure

System.Int64

LONG

OracleString structure

System.String

LONG RAW

OracleBinary structure

System.Byte[]

NCHAR

OracleString structure

System.String

NCLOB

OracleClob class

System.String

NUMBER

OracleDecimal structure

System.Decimal

NVARCHAR2

OracleString structure

System.String

PLS_INTEGER (PL/SQL only)

OracleDecimal Structure

System.Decimal

RAW

OracleBinary structure

System.Byte[]

REF

OracleRef class

System.String

REF CURSOR (PL/SQL only)

OracleRefCursor class

Not Applicable

ROWID

OracleString structure

System.String

TIMESTAMP

OracleTimeStamp structure

System.DateTime

TIMESTAMP WITH LOCAL TIME ZONE

OracleTimeStampLTZ structure

System.DateTime

TIMESTAMP WITH TIME ZONE

OracleTimeStampTZ structure

System.DateTime

UROWID

OracleString structure

System.String

VARCHAR2

OracleString structure

System.String

XMLType

OracleXmlType class

System.String


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值