Skip to Main Content

SQL & PL/SQL

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!

ORA-28113: policy predicate has error IN APEX

922989Mar 13 2012 — edited Mar 13 2012
Dear I am trying to impliment a VPD based security with Apex

The function I have used is

create or replace
FUNCTION CC_SEC (
p_schema IN VARCHAR2 DEFAULT NULL,
p_object IN VARCHAR2 DEFAULT NULL)
RETURN VARCHAR2
AS
begin
--RETURN 'upper(userid) = nvl(v(''APP_USER''),USER)';
RETURN '(upper(userid) = decode(nvl(v(''APP_USER''),USER),'||'''ADMIN'''||',upper(userid),nvl(v(''APP_USER''),USER)';
END;

and the add policy is as below

BEGIN
DBMS_RLS.add_policy
(object_schema => 'TMAPP',
object_name => 'USER_DST',
policy_name => 'DATA_SEL_POL',
function_schema => 'TMAPP',
policy_function => 'CC_SEC');
END;


here in the function cc_sec, I am tryin to use the decode option. If am using with out decode (the line is commented above), it will work without any issues. But after putting the decode I am getting the error ORA-28113: policy predicate has error from the apex login.

Please help

Dennis
This post has been answered by Frank Kulash on Mar 13 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 10 2012
Added on Mar 13 2012
4 comments
797 views