Hi!
I am trying to convert an existing view (read only) to a parametrized one, as per method #1 described here: http://www.orafaq.com/node/1922
(the reason is that using it is cleaner that the context variable approach - no extra statement for setting the variable, just a WHERE condition in the query)
The problem is, the subquery can no see the outer value.
The simplest form that fails is this:
select aaa.foo_val, bbb.* from tab1 aaa , (select * from tab2 where aaa.foo_val = CS_USERS.foo_val) bbb;
*
gives:
ERROR at line 1:
ORA-00904: "AAA"."FOO_VAL": invalid identifier
I found
this where it states:
Oracle doesn't correlate the subqueries nested more than one level deep
But in my case it is not more than one level deep, so I am confused, why does it not work.
Maybe I am overlooking something obvious, it is past midnight here....
Regards,
David
Edited by: xerces8 on Jul 28, 2011 12:13 AM