我收到此错误的原因:
error: bind message supplies 16 parameters, but prepared statement "" requires 15
代码:
const r1 = await client.query(`
INSERT INTO booking
(client_id, car_id, business_id, pick_up_station_id,
return_station_id, type, text, from_date, to_date, booking_range, km_free, km_extra, km_overdrawn, excess_back)
VALUES
($1, $2, $3, $4, $5, $6, $7, $8, $9, tsrange($10, $11, '()'), $12, $13, $14, $15) RETURNING ID;
`, [
p.client_id !== '' ? parseInt(p.client_id) : null,
parseInt(p.car_id), parseInt(p.business_id),
parseInt(p.business_id),
p.pick_up_station_id,
p.return_station_id,
p.type,
p.notice,
new Date(p.date_from),
new Date(p.date_to),
new Date(p.date_from),
new Date(p.date_to),
parseInt(p.free_km),
parseInt(p.extra_km),
0,
0
]);
我做错了什么?也许这个错误的出现是因为这个范围但不知道如何解决它
有人能帮我解决这个问题吗?
非常感谢!