Hi,
I've table TEST with these col:

NAME................VARCHAR2(50)
ADDRESS1............VARCHAR2(50)
STATE_ID............VARCHAR2(32)
CITY_ID.............VARCHAR2(48)
COUNTY_ID...........VARCHAR2(16)

CONNECT TOM/TOM@SERVICE
select count(*)
from test;

COUNT(*)
----------
2534

I'd like create a "virtual private database" to add a predicate to SELECT statement to user TOM
SELECT *
FROM TEST
WHERE NAME='JOHN';


select count(*)
from test
WHERE NAME='JOHN';

COUNT(*)
----------
2

When TOM connect to Oracle He must see just 2 records on table TEST

I know I must work following these steps:

1) connect sys/change_on_install@service as sysdba
grant create any context to TOM;
grant drop any context to TOM;
create context context_test using set_my_context;


2)connect TOM/TOM@SERVICE

create or replace package set_my_context as
procedure MY_TEST;
end;


create or replace package body set_my_context is
procedure MY_TEST is

WHAT I MUST WRITE HERE????


3)connect sys/change_on_install@service as sysdba

execute dbms_rls.add_policy ('object_schema','object_name',.........);



4)connect TOM/TOM@SERVICE

execute set_my_context.object_name;


create or replace trigger on_logon
after logon
on tom.schema
begin
set_my_context.object_name;
end;

How can I write my procedures to add security at my database????


Thanks
Raf