create or replace type t_obj_where as object(typ varchar2(50),val varchar2(50));
create or replace type t_tbl_where is table of t_obj_where;
create or replace package pkg_where is
g_where t_tbl_where := t_tbl_where();
END;
/
declare
v_where t_tbl_where;
v_id integer;
v_pol varchar2(30);
begin
select t_obj_where(typ,val) bulk collect into pkg_where.g_where
from (select 'POL' typ,'CNNGB' val from dual);
dbms_output.put_line(pkg_where.g_where.count);
select containerid,pol into v_id,v_pol from cm_containers a where a.pol in (select val from table(pkg_where.g_where)) and rownum=1;
p(v_id);
p(v_pol);
end;
/
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11990065/viewspace-775480/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/11990065/viewspace-775480/