I am getting this error message on this cursor. I am not sure what is wrong.
ERROR 1193 : Unknown system variable 'no_more_rows'
Dodge20
ERROR 1193 : Unknown system variable 'no_more_rows'
Code:
DELIMITER $$
DROP PROCEDURE IF EXISTS `link`.`CreateHTTextFiles` $$
CREATE PROCEDURE `link`.`CreateHTTextFiles` ()
BEGIN
DECLARE student_csr CURSOR FOR
SELECT student_name,student_address,student_hometown,student_state,student_major,
student_degree,student_honors,student_parent1,student_parent2,student_misc,
student_misc2,student_misc3,student_misc4,student_hsyear,student_hsname,
student_sort,student_gender,student_schname,student_schamt
FROM student,ht_zips
WHERE student_zip = htz_zip;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET no_more_rows=1;
SET no_more_students=0;
OPEN student_csr;
student_loop:REPEAT
FETCH student_crs INTO l_student_name,l_student_address,l_student_hometown,l_student_state,
l_student_major,l_student_degree,l_student_honors,l_student_parent1,
l_student_parent2,l_student_misc,l_student_misc2,l_student_misc3,
l_student_misc4,l_student_hsyear,l_student_hsname,l_student_sort,
l_student_gender,l_student_schname,l_student_schamt
IF no_more_rows THEN
LEAVE student_loop;
END IF;
SET lstudent_count=lstudent_count+1;
UNTIL nno_more_rows
END REPEAT student_loop;
CLOSE student_csr;
SET no_more_rows=0;
END $$
DELIMITER ;
Dodge20