Home » RDBMS Server » Server Administration » running a proc in another schema
running a proc in another schema [message #118122] Tue, 03 May 2005 03:07 Go to next message
vgs2005
Messages: 123
Registered: April 2005
Senior Member
I have a:
- Schema A which has a table T and procedure Proc. Inside Proc, table t is updated - specified as just t:

Procedure Proc
Begin
Update table t
set col1 = 10;
End;

- Schema B which has a another table T (same name as that of Schema A) and an execute privilege on procedure Proc of Schema A. If B runs Proc, whose table will it update?


Re: running a proc in another schema [message #118133 is a reply to message #118122] Tue, 03 May 2005 03:39 Go to previous message
Frank Naude
Messages: 4587
Registered: April 1998
Senior Member
Hi,

It depends if you are using Invoker's Rights or Definer's Rights (AUTHID Clause). For more info, see read the chapter "Using PL/SQL Subprograms" of the PL/SQL User's Guide and Reference Guide:

"By default, stored procedures and SQL methods execute with the privileges of their owner, not their current user. Such definer's rights subprograms are bound to the schema in which they reside, allowing you to refer to objects in the same schema without qualifying their names."

"...invoker's rights subprograms are not bound to a particular schema:

CREATE PROCEDURE create_dept (
my_deptno NUMBER,
my_dname VARCHAR2,
my_loc VARCHAR2) AUTHID CURRENT_USER AS
BEGIN
..."

Best regards.

Frank
Previous Topic: Error in SYS.OLAPIHISTORYRETENTION procedure
Next Topic: Creating database from UNIX files
Goto Forum:
  


Current Time: Sat Jan 25 03:19:10 CST 2025