Is there a simple Oracle syntax like a ternary operator or function?
These work:
with
function qry(v in varchar2) return varchar2 is
begin
return owa_util.ite(v like ('%' || lower('something') || '%'),'Y','N');
end;
select * from my_table where qry(my_col) = 'Y'
with
function qry(v in varchar2) return varchar2 is
begin
return case when v like('%' || lower('something') || '%') then 'Y' else 'N' end;
end;
select * from my_table where qry(my_col) = 'Y'
If there's a simpler, shorter syntax I would like to know.