当前位置:   article > 正文

mysql的错误1292_Mysql错误:错误代码:1292 . 截断不正确的DOUBLE值

截断不正确的double值

我在mySQL中执行此存储过程时收到此错误:

错误代码:1292 . 截断错误的DOUBLE值:'WHERE s.name ='确认'AND bp.id =''

DROP PROCEDURE IF EXISTS test;

DELIMITER //

CREATE PROCEDURE test (province VARCHAR(100), country VARCHAR(100), departureDate TIMESTAMP, arrivalDate TIMESTAMP, people INTEGER)

BEGIN

DECLARE selectClause VARCHAR(500) DEFAULT "SELECT DISTINCT b.id, b.boat_model_id, b.port_id, b.address_id, b.maximum_discount,

b.discounts_have_subtotals, b.skipper_type_id, b.length, b.people_capacity_id,

b.simple_cabin_id, b.double_cabin_id, b.bathroom_id, year_id ";

DECLARE fromClause VARCHAR(500) DEFAULT "FROM states s, boat_people bp, boat_prices bprd, boat_prices bpra, boats b ";

DECLARE whereClause VARCHAR(1000) DEFAULT "WHERE s.name = 'Confirmed'

AND bp.id = " + people + "

AND b.state_id = s.id

AND b.id NOT IN (SELECT bc.boat_id

FROM boat_calendars bc

WHERE (date(bc.since) <= " + departureDate + " AND date(bc.until) >= " + departureDate + ")

OR (date(bc.since) <= " + arrivalDate + " AND date(bc.until) >= " + arrivalDate + "))

AND bprd.boat_id = b.id

AND date(bprd.since) <= " + departureDate + " AND date(bprd.until) >= " + departureDate + "

AND bpra.boat_id = b.id

AND date(bpra.since) <= " + arrivalDate + " AND date(bpra.until) >= " + arrivalDate + "

AND truncate(((bprd.weekly_price + bpra.weekly_price)/2), 2) > 0";

SET @queryClause = concat(selectClause, fromClause, whereClause);

PREPARE stmt FROM @queryClause;

EXECUTE stmt;

DEALLOCATE PREPARE stmt;

END //

CALL test('Mallorca (Islas Baleares)', 'España', '2016-03-02 16:02:12', '2016-03-02 16:02:12', 1);

表boat_people.id是INT(11) .

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/607089
推荐阅读
相关标签
  

闽ICP备14008679号