delimiter // CREATE PROCEDURE curdemo() BEGIN DECLARE done INT DEFAULT 0; DECLARE a INT; DECLARE cur1 CURSOR FOR SELECT intCid FROM tblcountries; DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1; OPEN cur1; while not done do FETCH cur1 INTO a; INSERT INTO t1(n1) VALUES (a); END while; CLOSE cur1; END //
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)