Home » SQL & PL/SQL » SQL & PL/SQL » vpd condition with joins in DataWarehouse (oracle 11g)
icon6.gif  vpd condition with joins in DataWarehouse [message #637296] Thu, 14 May 2015 08:12 Go to next message
Droryash
Messages: 3
Registered: May 2015
Junior Member
Hi
I need Condition to the VPD.
on DIM tables, Only if there is no join with fac Then do VPD
ex:
select * from dim --> do VPD
But
select * from dim join fac on .. --> do'nt do VPD (it will have a different VPD for the facts)

Regards,
Dror
Re: vpd condition with joins in DataWarehouse [message #637297 is a reply to message #637296] Thu, 14 May 2015 08:30 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Welcome to this forum.

Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/ and read http://www.orafaq.com/forum/t/174502/
Re: vpd condition with joins in DataWarehouse [message #637312 is a reply to message #637296] Thu, 14 May 2015 16:00 Go to previous messageGo to next message
John Watson
Messages: 9003
Registered: January 2010
Location: Global Village
Senior Member
You could apply your VPD policies to views, rather than directly to the tables.
Re: vpd condition with joins in DataWarehouse [message #637398 is a reply to message #637312] Sun, 17 May 2015 00:53 Go to previous messageGo to next message
Droryash
Messages: 3
Registered: May 2015
Junior Member
O.K, But when I am in side the VPD function, How can I know that there is a join to the Fac_ table?

I'm trying :
--prev_exec_id
SELECT s.sid, s.username, sa.sql_text
FROM v$session s
JOIN v$session SS
ON ss.prev_exec_id = s.sql_exec_id
JOIN v$sql sa
ON s.sql_address = sa.address
AND s.sql_hash_value = sa.hash_value
WHERE s.schema# NOT IN (0, 24) --not sys
AND ss.audsid = SYS_CONTEXT('USERENV', 'SESSIONID') --MYSELF;

[Updated on: Sun, 17 May 2015 10:38]

Report message to a moderator

Re: vpd condition with joins in DataWarehouse [message #637429 is a reply to message #637398] Sun, 17 May 2015 10:32 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
Would you please have a look at How to use code tags.
Re: vpd condition with joins in DataWarehouse [message #637430 is a reply to message #637398] Sun, 17 May 2015 13:36 Go to previous messageGo to next message
John Watson
Messages: 9003
Registered: January 2010
Location: Global Village
Senior Member
I do not understand your problem. I would create views that join or do not join, and associate each view with an appropriate policy function. I have no idea what your (unformatted) code snippet is meant to do.
Re: vpd condition with joins in DataWarehouse [message #637440 is a reply to message #637430] Mon, 18 May 2015 00:55 Go to previous message
Droryash
Messages: 3
Registered: May 2015
Junior Member
In DATA WHAREHOUSE the users builds the query. So There is endless possibilities of how the query will look like.
In view we resolve only one specipic query, So it's not good enough.

What I need is to know weather there is a join with the prefix <FACT_...> in one if the tables.
and all this in side the vpd function (in the same session)
ex:
SELECT *
FROM dim_1 JOIN fact_1
ON dim_1.no = fact_1.no
Previous Topic: Calculation of Day, month and year
Next Topic: Procedure creation error - PLS-00103
Goto Forum:
  


Current Time: Tue Jul 28 02:22:39 CDT 2026