or 多条件

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/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值