ORA-28113: policy predicate has error IN APEX
922989Mar 13 2012 — edited Mar 13 2012Dear 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