私はこのようなものが欲しいです
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
;
マクロ置換のようなもので、節の$condition
上にある対応する SQL コードに置き換えられます。select
これはオラクルで可能ですか?