Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Username in PL/SQL
A keyboard was whacked upside Edward Beemer's head and out came:
>Hello guys,
>
>How can I use the username of the currently logged on user in a PL/SQL
>function?
>
>I would like to call some function with the current username as a parameter.
What, like this?
set serveroutput on
declare
function_result number;
function test(name in char) return number is begin
dbms_output.put_line(name); return 1;
begin
dbms_output.enable(1000000);
dbms_output.put_line(test(user));
end;
The expression 'user' always holds the session's username and is immutable. Hope that helps.
Gary
--
Gary O'Keefe
gary_at_onegoodidea.com
You know the score - my current employer has nothing to do with what I post Received on Thu Aug 26 1999 - 06:49:26 CDT