declare p_curstate int DEFAULT 0;
declare p_cur CURSOR for select id from zsyz_zsdh_industry_orientation where parent_id > 0;
declare CONTINUE HANDLER for NOT found set p_curstate = 1;
open p_cur;
FETCH p_cur into p_hyId;
WHILE p_curstate <> 1 DO
--业务逻辑处理----
FETCH p_cur into p_hyId;
END WHILE;
CLOSE p_cur