declare a varchar2(20); b varchar2(20); c varchar2(20); cursor mycur is select idnum,name,cardnum from 表B; begin open mycur; loop fetch mycur into a,b,c; exit when mycur%notfound; update 表A set idnum = a,name = b where cardnum=c; end loop; close mycur; end;