1615错误:需要在MySQL中重新准备Prepared语句

时间:2017-01-05 11:47:11

标签: mysql procedure

我有以下完美执行的存储过程。但是从早上起我就收到了错误

  

准备好的陈述需要重新准备

我尝试了所有的事情,却无法得到任何帮助。

CREATE PROCEDURE `SP_FEEDBACK_REPORT`(
    IN p_eventID INT(10),
    IN p_sessionID INT(10)
)
BEGIN
    SET SESSION group_concat_max_len = 10240;
    SET @sqlQry = NULL;

    SELECT GROUP_CONCAT(DISTINCT CONCAT(' MAX( IF(attended_id = ', attended_id, ', IF(answer_id !=47, (SELECT key_value FROM tblrating_master WHERE key_id=answer_id), comments),NULL)) AS ', attendee_name)) INTO @sqlQry FROM vwfeedback_report WHERE event_id=p_eventID AND session_id=p_sessionID;

    SET @sqlQry = CONCAT('SELECT question, ', @sqlQry, ' FROM vwfeedback_report WHERE event_id=', p_eventID,' AND session_id=', p_sessionID,' GROUP BY feedback_id;');
    -- SELECT @sqlQry FROM DUAL;
    PREPARE stmt FROM @sqlQry;
    EXECUTE stmt;
    DEALLOCATE PREPARE stmt;
    SET SESSION group_concat_max_len = 1024;
END;

请帮忙

0 个答案:

没有答案