oracle中游标的where条件中可以有case when 语句吗,具体写法是什么?
例如:
cursor cur_dalei(dalei in varchar2) is
select a.id,v.catalog
from bom a,cux b
where a.id=b.id
and (case when dalei is null then null end
case when dalei='设备' then v.catalog not like '%材料%' and v.catalog not like '%建筑%' end
case when dalei='材料' then v.catalog not like '%设备%' and v.catalog not like '%建筑%' end
case when dalei='建筑' then v.catalog not like '%设备%' and v.catalog not like '%材料%' end)
order by a.id;
这样执行不下去,语法有错误吗?还是cursor根本就不支持where条件后加case when语句?
急啊,麻烦各位了!