fetch 用法

declare
cursor cur(id in varchar2) is select * from tableb bb  where bb.sid=id;
tb tableb%rowtype;
begin
  open cur('02');
  loop
  fetch cur into tb;
    exit when cur%NOTFOUND;
     DBMS_OUTPUT.PUT_LINE(tb.fid || ' ' || tb.name || ' ' || tb.state ||' ' || tb.sid );
  end loop;
close cur;
end;

你可能感兴趣的:(fetch)