Understanding Definer and Invoker Rights

Whenever you execute a stored procedure or an object method, the success of the execution depends on whether appropriate permissions have been granted. The user whose permissions are checked depends on whether definer's rights or invoker's rights are in effect. By default, stored procedures and SQL methods are executed with the definer's rights. For example, suppose that we have a standalone procedure called add_customer in the schema csmith:

SQL> create procedure add_customer(new_custname varchar2(10),
2 new_custdesc varchar2(20)) as
3 begin
insert into customers(customer_id, name, comments)
values(custno_seq.nextval, new_custname, new_custdesc);
end;

If another user sjones has been given the permission ...

Get e-Commerce Applications Using Oracle8i and Java from Scratch now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.