How to create a lookup table from a subquery in a plsql block.
807684Mar 30 2011 — edited Mar 30 2011Hi,
I need help on a basic question in PLSQL.
I have a subquery which returns values of a column in a table, I use this subquery in WHERE condition with IN clause in a stored procedure..
I have multiple where conditions which needs the same subquery, Is there a way to store the records retruned by the subquery in a lookup table and check if the column value is present in the lookup table insted of doing it like the below example..
Ex
select 1 from table1
where col1 IN (subquey)
AND col2 IN (subquery)
AND col3 IN (subquery)
...
...
...;
if this is a very basic question, please give me a pointer, I will look up for more info, I was actually trying if I can get the subquery data in a collection like Associative Arrays, but was unable to lookup for the data in the collections..