Hi Group - I've addded an AND condition to a CASE that is used as a column. It was working before my change. I also created a funct, is_consortium_existing, that returns a boolean value which was tested and works. I now get compile error PL/SQL: ORA-00920: invalid relational operator What am I overlloking?
Original
SELECT a,
CASE
WHEN clpsh.clps_eff_frm_dt BETWEEN get_aff_eff_frm_dt(client.id, clpsh.eff_frm_dt,clpsh.eff_to_dt)
AND nvl(get_aff_to_dt(client.id,clpsh.eff_frm_dt,clpsh.eff_to_dt),to_date('31-DEC-2099','DD-MON-YYYY'))
THEN 'Y'
ELSE 'N'
END aff_ind,
c
From client, clh
Where ... ... ...
New
SELECT a,
CASE
WHEN clpsh.clps_eff_frm_dt BETWEEN get_aff_eff_frm_dt(client.id, clpsh.eff_frm_dt, clpsh.eff_to_dt)
AND nvl(get_aff_to_dt(client.id,clpsh.eff_frm_dt,clpsh.eff_to_dt),to_date('31-DEC-2099','DD-MON-YYYY'))
AND is_consortium_existing(clh.id, clh.prtnr, clh.cl_ch)
THEN 'Y'
ELSE 'N'
END aff_ind,
c
From client, clh
Where ... ... ...