<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Poor man&#039;s VPD &#8211; Virtual Private Database before 8i and in Standard Edition Databases</title>
	<atom:link href="http://technology.amis.nl/2005/10/04/poor-mans-vpd-virtual-private-database-before-8i-and-in-standard-edition-databases/feed/" rel="self" type="application/rss+xml" />
	<link>http://technology.amis.nl/2005/10/04/poor-mans-vpd-virtual-private-database-before-8i-and-in-standard-edition-databases/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=poor-mans-vpd-virtual-private-database-before-8i-and-in-standard-edition-databases</link>
	<description></description>
	<lastBuildDate>Tue, 11 Jun 2013 22:09:58 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Lucas Jellema</title>
		<link>http://technology.amis.nl/2005/10/04/poor-mans-vpd-virtual-private-database-before-8i-and-in-standard-edition-databases/#comment-2493</link>
		<dc:creator>Lucas Jellema</dc:creator>
		<pubDate>Sat, 08 Oct 2005 16:56:47 +0000</pubDate>
		<guid isPermaLink="false">/?p=827#comment-2493</guid>
		<description><![CDATA[I have not said as much, but it is probably obvious that when you want to impose policies on Insert, Update and Delete operations - which VPD can also do for you as of release 10g - you have to rely on either Insert, Update and Delete triggers - typically row level - or a View with a Check Option in those circumstances where your DML policies coincide with your Select policy. A View WITH CHECK option ensures that any INSERT of UPDATE will never lead to a result that can not be seen in the view itself.]]></description>
		<content:encoded><![CDATA[<p>I have not said as much, but it is probably obvious that when you want to impose policies on Insert, Update and Delete operations &#8211; which VPD can also do for you as of release 10g &#8211; you have to rely on either Insert, Update and Delete triggers &#8211; typically row level &#8211; or a View with a Check Option in those circumstances where your DML policies coincide with your Select policy. A View WITH CHECK option ensures that any INSERT of UPDATE will never lead to a result that can not be seen in the view itself.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anton</title>
		<link>http://technology.amis.nl/2005/10/04/poor-mans-vpd-virtual-private-database-before-8i-and-in-standard-edition-databases/#comment-2492</link>
		<dc:creator>Anton</dc:creator>
		<pubDate>Thu, 06 Oct 2005 11:34:03 +0000</pubDate>
		<guid isPermaLink="false">/?p=827#comment-2492</guid>
		<description><![CDATA[For the Dynamic predicate could also something like
&lt;pre&gt;
CREATE OR REPLACE PACKAGE tx IS
  TYPE t_emp IS TABLE OF emp%ROWTYPE;
END;
/
CREATE OR REPLACE FUNCTION y( p_limit in pls_integer := 1000 )
RETURN tx.t_emp pipelined
IS
  t_cur sys_refcursor;
  a_cur tx.t_emp;
  l_predicate varchar2(2000):= &#039;job = &#039;&#039;CLERK&#039;&#039;&#039;;
BEGIN
  OPEN t_cur FOR &#039;select * from scott.emp where &#039; &#124;&#124; l_predicate;
  LOOP
    FETCH t_cur BULK COLLECT INTO a_cur LIMIT p_limit;
    EXIT WHEN a_cur.count = 0;
    FOR i IN a_cur.first .. a_cur.last
    LOOP
      PIPE ROW( a_cur( i ) );
    END LOOP;
    EXIT WHEN t_cur%NOTFOUND;
  END LOOP
  RETURN;
END;
/
CREATE OR REPLACE VIEW emp AS SELECT * FROM TABLE( y )
/
&lt;/pre&gt;
 be used. Bulk collecting a refcursor wasn&#039;t available in Oracle 8i offcourse.]]></description>
		<content:encoded><![CDATA[<p>For the Dynamic predicate could also something like</p>
<pre class="wp-code-highlight prettyprint">
CREATE OR REPLACE PACKAGE tx IS
  TYPE t_emp IS TABLE OF emp%ROWTYPE;
END;
/
CREATE OR REPLACE FUNCTION y( p_limit in pls_integer := 1000 )
RETURN tx.t_emp pipelined
IS
  t_cur sys_refcursor;
  a_cur tx.t_emp;
  l_predicate varchar2(2000):= &#039;job = &#039;&#039;CLERK&#039;&#039;&#039;;
BEGIN
  OPEN t_cur FOR &#039;select * from scott.emp where &#039; || l_predicate;
  LOOP
    FETCH t_cur BULK COLLECT INTO a_cur LIMIT p_limit;
    EXIT WHEN a_cur.count = 0;
    FOR i IN a_cur.first .. a_cur.last
    LOOP
      PIPE ROW( a_cur( i ) );
    END LOOP;
    EXIT WHEN t_cur%NOTFOUND;
  END LOOP
  RETURN;
END;
/
CREATE OR REPLACE VIEW emp AS SELECT * FROM TABLE( y )
/
</pre>
<p> be used. Bulk collecting a refcursor wasn&#8217;t available in Oracle 8i offcourse.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric van Mourik</title>
		<link>http://technology.amis.nl/2005/10/04/poor-mans-vpd-virtual-private-database-before-8i-and-in-standard-edition-databases/#comment-2491</link>
		<dc:creator>Eric van Mourik</dc:creator>
		<pubDate>Tue, 04 Oct 2005 14:48:12 +0000</pubDate>
		<guid isPermaLink="false">/?p=827#comment-2491</guid>
		<description><![CDATA[Interesting post! Especially the ways you describe to use dynamic predicates.

The application developed and marketed by my former employer (ORCA by Truston) is/was based on such an implemention of a &quot;Poor Man&#039;s VPN&quot;.

You are stating two options for the creation of the views:
1. Rename all tables and create views in the same schema using the old tablenames.
2. Create the views in a second schema.

In my opinion, there is a third (more convienant) option: Create the views with a different name in the primary schema.
For example: The view based on table EMP will be named EMP_.
(Another - less transparant - way is explicitly creating the table with names in uppercase, and the views with names in lowercase (create view &quot;emp&quot; as select * from emp).)
Next, the (public) synonym that is (re)created for view EMP_  (or &quot;emp&quot;) will get the &quot;original&quot; name EMP.

Not stated in your post - but of course essential to the concept - is to revoke all the rights on the underlaying tables!
Otherwise users can easily ignore the authorization policies by prefixing their SQL-statements with the schema name.
This final step is often forgotten, as many developers do not realize that there are other ways to access the data then by means of the application/UI they are developing.]]></description>
		<content:encoded><![CDATA[<p>Interesting post! Especially the ways you describe to use dynamic predicates.</p>
<p>The application developed and marketed by my former employer (ORCA by Truston) is/was based on such an implemention of a &#8220;Poor Man&#8217;s VPN&#8221;.</p>
<p>You are stating two options for the creation of the views:<br />
1. Rename all tables and create views in the same schema using the old tablenames.<br />
2. Create the views in a second schema.</p>
<p>In my opinion, there is a third (more convienant) option: Create the views with a different name in the primary schema.<br />
For example: The view based on table EMP will be named EMP_.<br />
(Another &#8211; less transparant &#8211; way is explicitly creating the table with names in uppercase, and the views with names in lowercase (create view &#8220;emp&#8221; as select * from emp).)<br />
Next, the (public) synonym that is (re)created for view EMP_  (or &#8220;emp&#8221;) will get the &#8220;original&#8221; name EMP.</p>
<p>Not stated in your post &#8211; but of course essential to the concept &#8211; is to revoke all the rights on the underlaying tables!<br />
Otherwise users can easily ignore the authorization policies by prefixing their SQL-statements with the schema name.<br />
This final step is often forgotten, as many developers do not realize that there are other ways to access the data then by means of the application/UI they are developing.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
