I would like to have something like this
condition := case {SOME_VAR}
when 1 then 'tbl.id = 3 and tbl.code = 6'
when 2 then 'tbl.id != 4 and tbl.code = 5'
when 3 then 'tbl.id = 2 and tbl.code != 7'
else '1 = 1'
end
select
*
from
some_table tbl
where
$condition
;
and $condition
will be replaced with the corresponding SQL code from above the select
clause, something like a macro replacement. Is this possible in Oracle?