Oracle 嵌套表

CREATE  type addrs_type  IS TABLE OF varchar2(128);

create table employye (
eoid number(4),mailaddr addrs_type)
nested table mailaddr store as addr_table ;

insert into  employye values(123,addrs_type('aaa','bbb')) ;

DECLARE
addrs_table addrs_type;
begin
  SELECT mailaddr INTO addrs_table FROM employye WHERE eoid=123;
  FOR i IN 1..addrs_table.COUNT LOOP
      dbms_output.put_line(addrs_table(i));
  END LOOP;
end;

你可能感兴趣的:(oracle)