Are Joins possible with VPD predicates?
411450Dec 18 2003 — edited Jan 27 2004Hi everybody,
I have read the articles about VPD and row level security. What occurs to me is that all examples return predicates where the WHERE clause selects from the same table as the FROM clause. Is there a way to generate a predicate that goes to other tables as well?
Example:
table_1 holds sales records information, e.g.:
product, price, date of sale transaction.
table_2 holds information about the customers, e.g.:
customer_company, product, price, date_of_sale_transaction.
table_3 holds information about the customer account managers, e.g.:
employee_id, family_name, name, customer_company, customer_department.
Now if an account manager logs in to the database he shall only see the sold products in table_1 which were bought by the customers who he is in charge of. The select statement would something like:
select t1.product, t1.price from table_1 t1, table_2 t2, table_3 t3 where t1.product=t2.product and t2.customer_company=t3.customer_company and t3.employee_id=?
Certainly, ? would be the the id of the logged in user.
How can I realize a JOIN like this with VPD?
Thank you for every help!
Jie