dbms_rls.shared_static : dbms_rls « System Packages « Oracle PL/SQL Tutorial






SQL> begin
  2     dbms_rls.drop_policy (
  3        object_schema         => 'HR',
  4        object_name           => 'DEPT',
  5        policy_name           => 'EMP_DEPT_POLICY'
  6     );
  7     dbms_rls.add_policy (
  8        object_schema         => 'HR',
  9        object_name           => 'DEPT',
 10        policy_name           => 'EMP_DEPT_POLICY',
 11        function_schema       => 'RLSOWNER',
 12        policy_function       => 'AUTHORIZED_EMPS',
 13        statement_types       => 'SELECT, INSERT, UPDATE, DELETE',
 14        update_check          => true,
 15        policy_type           => dbms_rls.shared_static
 16     );
 17     dbms_rls.add_policy (
 18        object_schema         => 'HR',
 19        object_name           => 'EMP',
 20        policy_name           => 'EMP_DEPT_POLICY',
 21        function_schema       => 'RLSOWNER',
 22        policy_function       => 'AUTHORIZED_EMPS',
 23        statement_types       => 'SELECT, INSERT, UPDATE, DELETE',
 24        update_check          => true,
 25        policy_type           => dbms_rls.shared_static
 26     );
 27  end;
 28  /
begin
*
ERROR at line 1:
ORA-00942: table or view does not exist
ORA-06512: at "SYS.DBMS_RLS", line 59
ORA-06512: at line 2








31.22.dbms_rls
31.22.1.Call dbms_rls.add_policy to add policy to a table with statement type, update check and function schema
31.22.2.Add our policy to the EMP view
31.22.3.dbms_rls.drop_policy
31.22.4.dbms_rls.shared_static
31.22.5.dbms_rls.drop_policy and dbms_rls.add_policy