大部分類型的對應關係:原文:http://2143892.blog.51cto.com/2133892/499353html
序號git |
Oracle數據類型spa |
.NET類型htm |
GetOracleValue類型blog |
DbTypeci |
OracleTypeget |
1string |
BFILEit |
byte[]table |
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、Int1六、Int3二、Int6四、Decimal |
SByte、Int1六、Int3二、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。