until id end repeat;   这句话有问题一般这样使用
declare continue handler for not found set no_more_row = -1;  可以baidu一下看看具体用法

解决方案 »

  1.   

    哦哦、这个我现在修改的:BEGIN
    DECLARE
    id VARCHAR(100);DECLARE
    table_name_cursor CURSOR FOR SELECT
    log_id
    FROM
    cancelOrder;
         declare done int default false;
         declare continue handler for not found set done=true;
    OPEN table_name_cursor;
             repeat
    FETCH table_name_cursor INTO id;
         until done end repeat;
    CLOSE table_name_cursor;END 但是都是只取第一个就退出了,这个怎么回事?
      

  2.   

    declare done int default false;这部分应该在declare cursor 前面吧
      

  3.   

    运用Loop循环可以,你自己看看用法
      

  4.   

    建议在有问题的时候先参考一下MYSQL的官方免费手册。