更新行的MySQL过程

时间:2017-10-10 09:25:08

标签: mysql sql stored-procedures

我无法让以下工作。我做错了什么?

DELIMITER //
CREATE PROCEDURE base_insert
(IN in_visitor_id VARCHAR (256), IN in_booking_ref VARCHAR (256), IN in_stage_name VARCHAR (256), IN in_difficulty VARCHAR (256), IN in_lead_quality VARCHAR (256))
BEGIN
    UPDATE visitors 
    SET 
        booking_ref = in_booking_ref,
        deal_stage = in_deal_stage,
        deal_difficulty = in_deal_difficulty,
        lead_quality = in_lead_quality
    WHERE visitor_id = in_visitor_id//
END//
DELIMITER ;

1 个答案:

答案 0 :(得分:1)

从WHERE中删除//

DELIMITER //
CREATE PROCEDURE base_insert
(IN in_visitor_id VARCHAR (256), IN in_booking_ref VARCHAR (256), IN in_stage_name VARCHAR (256), IN in_difficulty VARCHAR (256), IN in_lead_quality VARCHAR (256))
BEGIN
    UPDATE visitors 
    SET 
        booking_ref = in_booking_ref,
        deal_stage = in_deal_stage,
        deal_difficulty = in_deal_difficulty,
        lead_quality = in_lead_quality
    WHERE visitor_id = in_visitor_id;
END//
DELIMITER ;