Oracle 数据类型 与C#映射关系
大部分类型的对应关系:原文:http://2143892.blog.51cto.com/2133892/499353
序号 |
Oracle数据类型 |
.NET类型 |
GetOracleValue类型 |
DbType |
OracleType |
1 |
BFILE |
byte[] |
OracleBFile |
|
BFile |
2 |
BLOB |
byte[] |
OracleLob |
|
Blob |
3 |
CHAR |
string |
OracleString |
AnsiStringFixedLength |
Char |
4 |
CLOB |
string |
OracleLob |
|
Clob |
5 |
DATE |
DateTime |
OracleDateTime |
DateTime |
DateTime |
6 |
FLOAT |
Decimal |
OracleNumber |
Single、Double、Decimal |
Float、Double、Number |
7 |
INTEGER |
Decimal |
OracleNumber |
SByte、Int16、Int32、Int64、Decimal |
SByte、Int16、Int32、Number |
8 |
INTERVAL YEAR TO MONTH |
Int32 |
OracleMonthSpan |
Int32 |
IntervalYearToMonth |
9 |
INTERVAL DAY TO SECOND |
TimeSpan |
OracleTimeSpan |
Object |
IntervalDayToSecond |
10 |
LONG |
string |
OracleString |
AnsiString |
LongVarChar |
11 |
LONG RAW |
byte[] |
OracleBinary |
Binary |
LongRaw |
12 |
NCHAR |
string |
OracleString |
StringFixedLength |
NChar |
13 |
NCLOB |
string |
OracleLob |
|
NClob |
14 |
NUMBER |
Decimal |
OracleNumber |
VarNumeric |
Number |
15 |
NVARCHAR2 |
string |
OracleString |
String |
NVarChar |
16 |
RAW |
byte[] |
OracleBinary |
Binary |
RAW |
17 |
ROWID |
string |
OracleString |
AnsiString |
Rowid |
18 |
TIMESTAMP |
DateTime |
OracleDateTime |
DateTime |
Timestamp |
19 |
VARCHAR2 |
string |
OracleString |
AnsiString |
VarChar |
Number是最多变化的类型:原文:http://www.cnblogs.com/xuzhiwei/p/3998446.html
cle | DB2/400 | C | C# | C/C#数据范围 |
NUMBER | Float(n)/REAL/DOUBLE | double | double |
1.7E +/- 308 (15 digits) |
NUMBER(p) p<=4 |
SAMLLINT DECIMAL(p) NUMBER(p) |
short | Int16 |
–32,768 to 32,767 NUMBER(5) |
NUMBER(p) 5<=p<=9 |
INTEGER DECIMAL(p) NUMBER(p) |
int | Int32 |
–2,147,483,648 to 2,147,483,647 NUMBER(10) |
NUMBER(p) 10<=p<=19 |
BIGINT DECIMAL(p) NUMBER(p) |
__int64 | Int64 |
–9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 NUMBER(19) |
NUMBER(p,s) p=7 s=3 |
Float(n) DECIMAL(p,s) NUMBER(p,s) |
float |
float |
3.4E +/- 38 (7 digits) |
NUMBER(p,s) p=15 s=5 |
REAL DECIMAL(p,s) NUMBER(p,s) |
double | double |
1.7E +/- 308 (15 digits) |
NUMBER(p,s) p=15 s=5 |
DOUBLE DECIMAL(p,s) NUMBER(p,s) |
double | double |
1.7E +/- 308 (15 digits)
|
Oracle 是没有boolean 类型的,因此要用Number(1) ,存储1,0 再在程序中转换为boolean。