How do I hear predicates VPD-added in the context of the insert statements

Hello

I'm working on a project, where VPD will be used to separate data between users. We are on 12.1.0.2 on Windows 2012.

Now, I understand that the predicates generated by the policy_function are added for select, update, delete. But I don't understand how an additional predicate works with inserts. I also can't make it work in my little example. V $ vpd_policy I see a 0 = 1 for insertions added predicate, but inserts succeeds, contrary to my expectation.

Can someone explain this to me.

Regards Niels Jespersen

Here's how to insert can work against EVP:

(Vlad_t1) CREATE or REPLACE FUNCTION

schema_var IN VARCHAR2,

table_var in VARCHAR2

)

RETURN VARCHAR2

IS

return_val VARCHAR2 (400);

BEGIN

return_val: = 'ID = 1';<>

RETURN return_val;

END vlad_t1;

/

BEGIN

DBMS_RLS. () ADD_POLICY

object_schema-online "vlad"

object_name-online "t1,"

POLICY_NAME-online "vld_policy."

function_schema-online "sys."

policy_function-online "vlad_t1."

statement_types => ' select, insert, update, delete.

update_check-online TRUE

);

END;

/

SQL > select * from vlad.t1;

ID NAME

---------- ------------------------------

1 VLAD

1 JAX

GORO 2

3 SUB-ZERO

4 SCORPION

SQL > conn vlad/vlad

Connected.

SQL > select * from t1;

ID NAME

---------- ------------------------------<>

1 VLAD

1 JAX

SQL > update t1 set name = "OTHER_FIGHTERS";

2 lines to date.<>

SQL > select * from t1;

ID NAME

---------- ------------------------------

1 OTHER_FIGHTERS

1 OTHER_FIGHTERS

SQL > insert into t1 values (1, "KITANA");

1 line of creation.

SQL > select * from t1;

ID NAME

---------- ------------------------------

1 OTHER_FIGHTERS

1 OTHER_FIGHTERS

1 KITANA

SQL > insert into t1 values (5, "KENSHI");<>

insert into t1 values (5, "KENSHI")

*

ERROR on line 1:

ORA-28115: with check option violation policy

Tags: Database

Similar Questions

Maybe you are looking for