--here's the problem scenario

--created the following users
create user test identified by test;
grant connect, resource to test;
grant create any context to test;
grant administer database trigger to test;
create user jordan identified by jordan;
grant connect to jordan;
create user roby identified by roby;
grant connect to roby;

connect test/test;
create table emp(name varchar2(15), username varchar2(7) default user);
grant all on emp to jordan;
grant all on emp to roby;

connect jordan/jordan;
insert into test.emp values('Neil Jordan', user);

connect roby/roby;
insert into test.emp values('Jack Roby', user);

--users test, jordan and roby can all view all rows from the table emp
SQL> select * from test.emp;
NAME USERNAM
--------------- -------
Neil Jordan JORDAN
Jack Roby ROBY

--want to apply row level security so that test can view all rows, while
--jordan and roby can only view their own rows

SQL>connect test/test;

SQL> create or replace context example_context using set_my_context;
Context created.

SQL> create or replace package emp_chk is
2 function verify(obj_schema varchar2, obj_name varchar2) return
varchar2;
3 end;
4 /
Package created.

SQL> create or replace package body emp_chk is
function verify(obj_schema varchar2, obj_name varchar2) return varchar2 is
d_predicate varchar2(2000);
begin if
sys_context('example_context','user_type')='someon e'
then d_predicate:=
'username=sys_context(''userenv'',''session_user'' )';
end if;
return d_predicate;
end;
end;
/
Package body created.

connect system/tiger;
SQL> begin
2 dbms_rls.add_policy(object_schema=>'test',
3 object_name=>'emp',
4 policy_name=>'my_security_check',
5 function_schema=>NULL,
6 policy_function=>'emp_chk.verify',
7 statement_types=>'select, insert, update, delete',
8 update_check=>true,
9 enable=>true);
10 end;
11 /

PL/SQL procedure successfully completed.

SQL>connect test/test;
SQL> Create or replace package set_my_context is
2 procedure imSomeone(my_name varchar2, my_app_password varchar2);
3 end;
4 /
Package created.

SQL> Create or replace package body set_my_context is
2 procedure imSomeone(my_name varchar2, my_app_password varchar2)
3 is
4 begin
5 dbms_session.set_context('example_context','user_t ype','someone');
6 end;
7 end;
8 /

Package body created.

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

*** however now neither the user test nor users roby n jordan can view any rows from the table emp;

SQL> select * from emp;
select * from emp
*
ERROR at line 1:

ORA-28110: policy function or package SYSTEM.EMP_CHK has error

***I AM DOING SOMETHING WRONG...can't figure out what! Any help would be greatly appreciated! Thanx