Hi,
I have an Oracle Form I am logging into as user ROGADM. From this form I execute a packaged procedure PROC (package is defined with "authid definer") at the schema of SYSUTLADM user. From the PROC I execute a standalone function FUNC defined with "authid current_user". Why the statement:
SELECT user FROM user_users;
returns SYSUTLADM?
Shouldn't it return ROGADM according to the documentation? (http://docs.oracle.com/cd/B19306_01/appdev.102/b14261/subprograms.htm#i18574):
Who Is the Current User During Subprogram Execution?
In a sequence of calls, whenever control is inside an invoker's rights subprogram, the current user is the session user. When a definer's rights subprogram is called, the owner of that subprogram becomes the current user. The current user might change as new subprograms are called or as subprograms exit.
To verify who the current user is at any time, you can check the USER_USERS
data dictionary view. Inside an invoker's rights subprogram, the value from this view might be different from the value of the USER
built-in function, which always returns the name of the session user.
I'm using DB 10g.
Thanks in advance,
Jack