Numeric data types are able to stores zero as well as either positive or negative.
NUMBER[(precision [, scale])]
1. It is used for values with decimal point.
2. Number having precision p and scale s.
3. The precision p can range from 1 to 38.
4. The scale s can range from -84 to 127.
5. Both precision and scale are in decimal digits.
6. A NUMBER value requires from 1 to 22 bytes.
Specify an integer using the following form:
NUMBER(p)
1. It used to store numbers without decimal point.
2.
This
represents a fixed-point number with precision p and scale 0 and is equivalent to NUMBER(p,0).
Specify a floating-point number using the following form:
NUMBER
The absence of precision and scale designators specifies the maximum range and precision for an Oracle number.
|
Actual Data |
Specified As |
Stored As |
|
123.89 |
NUMBER |
123.89 |
|
123.89 |
NUMBER(3) |
124 |
|
123.89 |
NUMBER(3,2) |
exceeds precision |
|
123.89 |
NUMBER(4,2) |
exceeds precision |
|
123.89 |
NUMBER(5,2) |
123.89 |
|
123.89 |
NUMBER(6,1) |
123.9 |
|
123.89 |
NUMBER(6,-2) |
100 |
|
.01234 |
NUMBER(4,5) |
.01234 |
|
.00012 |
NUMBER(4,5) |
.00012 |
|
.000127 |
NUMBER(4,5) |
.00013 |
|
.0000012 |
NUMBER(2,7) |
.0000012 |
|
.00000123 |
NUMBER(2,7) |
.0000012 |
|
1.2e-4 |
NUMBER(2,5) |
0.00012 |
|
1.2e-5 |
NUMBER(2,5) |
0.00001 |
No comments:
Post a Comment