has recently been working on an Oracle database-related program.
The correspondence between the number type of Oracle and the C language, the C # language type, has been found on the network for a long time, and no explanatory text has been located.
But in http://oracle.chinaitlab.com/induction/734741.html there is a "Oracle and DB2 data type classification corresponding to the description," according to this article, I summarized the number type of Oracle and C language, C #语言类型的对应关系.
number, which is stored in decimal format, is easy to store, but in the calculation, it is automatically converted into binary operation. It is defined by number (p,s), P is precision, maximum 38 bits, S is the scale range, can be in-84 ... 127 values. For example: Number (5,2) can be used to store the representation-999.99 ... 999.99-room value. P, S can be omitted in the definition, for example: Number (5), number, etc.;
First of all, it must be declared that Oracle's number type and C language, C # language type of correspondence can not be completely one-to-one, the table below only as a general reference.
Oracle |
db2/400 |
C |
C# |
c/c# Data range |
Number |
Float (n)/real/double |
Double |
Double |
1.7E +/-308 (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 +/-(7 digits) |
Number (P,s) P=15 s=5 |
REAL DECIMAL (P,s) Number (P,s) |
Double |
Double |
1.7E +/-308 (digits) |
Number (P,s) P=15 s=5 |
DOUBLE DECIMAL (P,s) Number (P,s) |
Double |
Double |
1.7E +/-308 (digits) |
Oracle's Numer type corresponds to the c,c# data type