I have following stored procedure which was executing perfectly. But since morning I am getting the error
Prepared statement needs to be re-prepared
I tried all the things but could not get any help.
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;
Please help