sql-formatter icon indicating copy to clipboard operation
sql-formatter copied to clipboard

mysql: create procedure LOOP bug

Open zundaren opened this issue 11 months ago • 3 comments

 label:
 LOOP
        FETCH cur_1 INTO
            event_id,only_code,garage,space;

        IF done THEN
            LEAVE label;
        END IF;

        set @SqlStmtA1 = concat('delete from ', eventtablename, ' where id=', event_id);
        prepare stmtA1 FROM @SqlStmtA1;
        EXECUTE stmtA1;

        COMMIT;
    END LOOP;
    CLOSE cur_1;

image

zundaren avatar Mar 23 '24 08:03 zundaren