DECIMAL ????????????

DECIMAL???????????????????????????????????????????????????????????????????????? ?????????????????????(????????????????????????????????????)????????????(????????????????????????)???????????????????????? ?????????????????????????????????????????????????????????????????????????????????????????????

??????

{ DECIMAL | DEC } [(?????? [, ????????? ])]

?????????1??????31????????????????????????????????????????????????????????????????????????

?????????????????????????????????????????????????????????0????????????????????????????????????????????????????????????????????????5??????????????????

DECIMAL???????????????????????????????????????????????????????????????????????????????????????????????? DECIMAL?????????????????????????????????????????????Derby??????????????????????????????

????????????
-- ????????????????????????????????????????????????????????????
values cast (1.798765 AS decimal(5,2));
1
--------
1.79
-- ?????????????????????????????????????????????
values cast (1798765 AS decimal(5,2));
1
--------
ERROR 22003: The resulting value is outside the range 
for the data type DECIMAL/NUMERIC(5,2).

???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

??????????????????????????????????????????????????????????????????????????????

?????????DECIMAL????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

?????????????????????????????????Java??????

java.math.BigDecimal

JDBC ????????????????????? (java.sql.Types)

DECIMAL

VALUES 123.456

VALUES 0.001

BIGINT??????????????????????????????????????????DECIMAL???????????????????????????