Hello,
I want to create a view like:
create or replace view oferte_la_culegere_vw(pcod_lucrare varchar2, pcod_tipprodso varchar2) is
select ol.cod_oferta from oferte_lucrare ol
join oferte o on o.cod_oferta = ol.cod_oferta
where ol.cod_tip_lucrare = pcod_lucrare
and (ol.activ = 'D' or
case when ol.activ = 'I' then
if os_util.are_atributie(o.atributie_exceptie) then ... -- add condition or ol.activ = 'N' to the query
)
intersect
select t.cod_oferta from tipinstprodso_oferta
where t.cod_tipprodso = pcod_tipprodso
order by 1;
show errors view oferte_la_culegere_vw;
So in the 1st select i have to filter only for ol.activ = 'D', but i can select records with ol.activ = 'N', only if that condition matches (os_util.are_atributie...).
How can i specify this in a view?
Thanks