次のように、Oracleプロシージャ(または可能であればOracleパッケージでも)で再利用したいパラメータ化された(動的)クエリが1つあります。
cursor q (p1 integer, p2 integer, p3 ...) as
select .... from .... where col1 = p1 and col2 = p2 and ....
後で後続のクエリでこのようなことを行います
select ...
from t1, t2, ..., q (a, b, c)
where q.c1 = t1.tc1
and q.c2 = t2.tc2
....
select ...
from n1, n2, ..., q (a, b, c)
where q.c1 = n1.tc1
and q.c2 = n2.tc2
....
クエリが静的だった場合、私はVIEWSを使用しましたが、そうではありません..多くの追加オブジェクトを埋めて使用する代わりに、他の簡単な方法はありますか?