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!

Free Oracle SQL Tuning Guide

Checkout my FREE guide, 7 SQL Tuning Secrets You Can Use Immediately, Even If You’ve Never Tuned a Query In Your Life!

Get it here: tuningsql.com/secrets

7 SQL Tuning Secrets You can Use Immediately, Even If You've Never Tuned A Query In Your Life

Leave a Reply

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