I have a query like
SELECT id FROM xyz WHERE ...;
which has a more or less complex WHERE clause and returns exactly one row with one column (ID). I need this ID for several later queries in a script. So my goal was to reuse this result in a variable but I don´t come to a solution which works.
Joining this query would not be a good option in this circumstance. So is it possible to tell Oracle to store this single result in a variable and use this variable to build up new queries - explicitly to use in in the conditional clause of other queries?
If so, perhaps somebody could post a simple example - most simple perhaps would be sth. like
SELECT :VARIABLE FROM DUAL
