我正在尝试在 PostgreSQL 数据库中运行以下 DML 语句:
INSERT INTO HMS_RESERVE_CANCEL_DTL
(DIVISION_CODE,
UNIT_CODE,
RESERVATION_NO,
RESERVATION_DATE,
CANCELLATION_NO,
CANCELLATION_DATE,
CANCELLED_AT_UNIT,
CANCELLATION_AMOUNT,
CANCELLED_BY,
CANCELLATION_REASON,
REFUND_AMOUNT,
POSTED_TO_FAS,
CANCEL_PER,
room_type,
no_of_rooms,
taxes )
values(
'103',
'10303',
'GHA1314HTLRS000157',
case trim('') when trim('08-05-2013') then null else to_date('08-05-2013','DD-MM-YYYY HH24:MI:SS') end,
'GHA1314HTLCL000002',
current_date,
'10303',
5200.0,
'001721',
'my parsanal',
'53260.00',
'N',
10.0,
'02',
'10',
'10320.0')
上面的语句开始但很快就失败了,并出现以下错误消息:
ERROR: numeric field overflow
SQL state: 22003
Detail: The absolute value is greater than or equal to 10^4 for field with precision 6, scale 2.
请帮助我摆脱这个错误(或者至少指出我正确的方向)。我的表 ( hms_rserve_cancel_dtl
) 的表结构如下:
CREATE TABLE hms_reserve_cancel_dtl
(
division_code character varying(3) NOT NULL,
unit_code character varying(5) NOT NULL,
reservation_no character varying(20) NOT NULL,
reservation_date date NOT NULL,
cancellation_no character varying(20) NOT NULL,
cancellation_date date NOT NULL,
cancelled_at_unit character varying(15) NOT NULL,
cancellation_amount numeric(7,2),
cancelled_by character varying(35),
cancellation_reason character varying(200),
refund_amount numeric(7,2),
posted_to_fas character(1) DEFAULT 'N'::bpchar,
posted_date date,
remarks character varying(200),
status character(1) DEFAULT 'A'::bpchar,
cancel_per numeric(7,2),
room_type character varying(2),
no_of_rooms character varying(2),
refund_status character(1),
refunded_date date,
taxes numeric(6,2) DEFAULT 0.00,
CONSTRAINT hms_reserve_cancel_dtl_div_unit_code_fkey FOREIGN KEY (division_code, unit_code)
REFERENCES aptdc_units_mst (division_code, unit_code) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT hms_reserve_cancel_dtl_reservation_no_fkey FOREIGN KEY (reservation_no, room_type)
REFERENCES hms_reservation_mst (reservation_no, room_type) MATCH SIMPLE
ON UPDATE RESTRICT ON DELETE RESTRICT
)
WITHOUT OIDS;
ALTER TABLE hms_reserve_cancel_dtl OWNER TO postgres;
GRANT ALL ON TABLE hms_reserve_cancel_dtl TO postgres;