Oracle返回表集合函数

来源:互联网 发布:e商网淘宝代发靠谱吗 编辑:程序博客网 时间:2024/05/16 17:32
create or replace type type_col as object(e varchar2(36 char),n varchar2(100 char));create or replace type type_tab  as table of type_col;create or replace function f_return_rowtype(v_id varchar2)  return type_tab  pipelined as  v type_col; begin  for myrow in (select e, n                  from tab e                 where                  start with e.id = v_id) loop    v := type_col(myrow.e, myrow.n);      pipe row(v);    end loop;  return;exception  when others then    dbms_output.put_line('sqlcode : ' || SQLCODE);    dbms_output.put_line('sqlerrm : ' || SQLERRM);end;

0 0