views:

35

answers:

0

Hey guys I have a stored procedure which does not need to return any values. It runs smoothly and without any problem. However, it outputs an error message (Error: No data - zero rows fetched, selected, or processed) after finishing its run. How can I get rid of this error message? (It is a simplified version of the procedure so, please don't tell me I can get rid of the loop or the whole stored procedure for such a simple task)

Thank you guys. Your help is really appreciated.

CREATE PROCEDURE `testing_proc`()  
    READS SQL DATA  
BEGIN  
    DECLARE done INT DEFAULT 0;
    DECLARE l_name VARCHAR(20);
    DECLARE my_cur CURSOR FOR
        SELECT name FROM customer_tbl;
    OPEN my_cur;
        my_cur_loop:
        LOOP FETCH my_cur INTO l_name;
            IF done = 1 THEN
                LEAVE my_cur_loop;
            END IF;
            INSERT INTO names_tbl VALUES(l_name);
        END LOOP my_cur_loop;
    CLOSE my_cur;
END