Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

authid current_user

JackKJan 15 2015 — edited Jan 15 2015

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

This post has been answered by BluShadow on Jan 15 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 12 2015
Added on Jan 15 2015
7 comments
2,357 views