Oracle's Numer type corresponds to the c,c# data type

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.