Oracle number
number [(P [, S])]
Number has precision p and scale s. theprecision p can range from 1 to 38. The scale S can range from-84 to 127. Bothprecision and scale is in decimal digits. A number value requires from 1 to 22bytes.
the scale is optional.
sql> Drop Tablet_number Purge;
Table dropped
Sql> Create Tablet_number (ID number (5), ID1 number (5,3));
Table created
sql> Insert Intot_number values (10000.8999999999999999999999299988888888888889,10.003);
1 row inserted
sql> Insert Intot_number values (10000.8999999999999999999999299988888888888889,10.0034);
1 row inserted
sql>--insert intot_number values (10000.8999999999999999999999299988888888888889,100.003); -- Error
Sql> commit;
Commit Complete
sql> SELECT * Fromt_number;
ID ID1
------ -------
10001 10.003
10001 10.003
in the definition of number in Oracle:
1.when there is only one parameter, such as number. Represents the maximum number of defined digits that can be set to a full -bit integer.
2, there are two parameters, such as number (38,3). Indicates that the defined number is a maximum of 3 decimal places. That is, this type can be set to a maximum of 3 decimal places .
3, the decimal place exceeds the length will be rounded, the whole digit exceeds the length error .
This article is from the "90SirDB" blog, be sure to keep this source http://90sirdb.blog.51cto.com/8713279/1940538
Oracle Data Type Number