declare
  onum o_orders.ono%type;
  cursor c is
    select nt.pno, nt.qty
    from   THE(select o.odetails
               from   o_orders o
               where  o.ono = onum) nt;

  pnum parts.pno%type;
  qtty number;

begin
  onum := 1020;

  open c;
  loop
    fetch c into pnum,qtty;
    exit when c%notfound;
    dbms_output.put_line('PNO = ' || pnum || '  QTY = ' || qtty);
   end loop;
end;
/
show errors


