Hi All,
I have sub queries in a package that are frequent. How can I avoid copying and pasting the same sub queries in multiple places? How can I reuse the result set.
The queries are very slow, I am trying to see if I can use some mechanism where I can store the result set from one query to be used in other proc or statements..
The queries are much more complicated than what I have given in the example below
proc1 as
Select
WITH a as
(select t1.code from t1, t2
where....),
col
FROM t
where a.gk= t.gk;
...
...
Insert into Auth_Customer from above query ;
...
...
...
ENd proc1;
proc2 as
Select
WITH a as
(select t1.code from t1, t2
where....),
col
FROM t
where a.gk= t.gk
...
...
Insert into GK_REC from above query ;
...
...
...
End proc2;
How can I avoid above.
Thank you for all the help!!!