If you’re receiving the ORA-28104: input value for statement_types is not valid error, it might be because you are trying to apply a row-level security policy to a table in a database that has been upgraded to 12.2 or greater using a script that was designed for 12.1 or earlier.

Example command:

begin
  dbms_rls.add_policy(
      object_schema => 'TABLE_OWNER'
    , object_name => 'TABLE_NAME'
    , policy_name => 'TABLE_NAME'
    , function_schema => 'VPD'
    , policy_function => 'VPDSECURITY.SOME_ACCESS_POLICY'
    , statement_types => 'select, insert, update, delete'
    , policy_type => dbms_rls.shared_context_sensitive
  );
end;
/

The solution may be as simple as adding the UPDATE_CHECK parameter to your ADD_POLICY function:

begin
  dbms_rls.add_policy(
      object_schema => 'TABLE_OWNER'
    , object_name => 'TABLE_NAME'
    , policy_name => 'TABLE_NAME'
    , function_schema => 'VPD'
    , policy_function => 'VPDSECURITY.SOME_ACCESS_POLICY'
    , statement_types => 'select, insert, update, delete'
    , policy_type => dbms_rls.shared_context_sensitive
    , update_check => true
  );
end;
/

Hopefully this fixes it for you–good luck!

Leave a Reply

Your email address will not be published. Required fields are marked *