Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Virtual Private Database Error ORA-28113 : policy predicate has error

Lawrence Luk-OracleDec 23 2013 — edited Jan 2 2014

Hi All,

I try to add a VPD policy to table po_headers_all. It prompts error ORA-28113 when I select the table after apply the policy.  I find out that if the returned string for the policy function contains the policy object name then it prompts error

Here is the example

BEGIN

DBMS_RLS.ADD_POLICY (

  object_schema    => 'po',

  object_name      => 'po_headers_all',

  policy_name      => 'xxpo_poauth',

  function_schema  => 'apps',

  policy_function  => 'xxpo_poauth',

  statement_types  => 'select');

END;

The policy function is

CREATE OR REPLACE FUNCTION xxpo_poauth(

  schema_var IN VARCHAR2,

  table_var  IN VARCHAR2

)

RETURN VARCHAR2

IS

       lv_return_val VARCHAR2(400);

       lv_user_name  VARCHAR2(400);

       lv_attr_group VARCHAR2(400) DEFAULT 'Ownership Details';

BEGIN

          lv_return_val := 'po_header_id  = (select po_header_id from po_headers_all where po_header_id = 428)';

          RETURN lv_return_val;

END xxpo_poauth;


Since I try to add the policy to table po_headers_all and the policy function return string contain table name po_headers_all.

Do any one knows if it is a bug or the restriction of the VPF function? and if there any work around?


Thanks in advance


Lawrence


Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 30 2014
Added on Dec 23 2013
2 comments
1,743 views