开发者

Is the first predicate in effect when I reference the first table after using a predicate to filter it, then in a second predicate on another table?

开发者 https://www.devze.com 2022-12-10 21:39 出处:网络
Using the Oracle VPD facility(aka RLS, aka FGAC), suppose that I use the predicate (WHERE) id = \'XXXX\'

Using the Oracle VPD facility(aka RLS, aka FGAC), suppose that I use the predicate

(WHERE) id = 'XXXX'

on TableA and then I use the predicate

(WHERE) col in (SELECT col From TableA)

on TableB.

Will TableA be filtered or not? Is filtering is done only outside of predicate 开发者_如何转开发definitions, when you query the tables? Will I need to make predicate on TableB like this?:

(WHERE) col in (SELECT col From TableA where id ='XXXX')


Yes, TableA will be automatically filtered using the predicate you specified (id = 'XXXX'). Oracle automatically applies the filters wherever you use (select from, in this case) the table, even in sub-queries, if the filter criteria is met (see sec_relevant_cols).

0

精彩评论

暂无评论...
验证码 换一张
取 消