update table1 t set t.num = t.num+1where t.num >= ( select first 1 t2.num from ( select first :index t3.num from table1 t3 order by num ) t2 order by t2.num desc)
update table1 t set t.num = t.num+1where t.num >= :index
update table1 tright join ( select t4.id from table1 t4 where t4.num >= ( select first 1 t2.num from ( select first :index t3.num from table1 t3 order by num ) t2 order by t2.num desc ) order by num desc) t5 on t5.id = t.idset t.num = t.num + 1
execute block(:index integer)declare asbegin for select t.id from table1 t where t.num >= ( select first 1 t2.num from ( select first :index t3.num from table1 t3 order by num ) t2 order by t2.num desc ) into :id as cursor cur do update table1 t set t.num = t.num + 1 where current of cur;end