Re: Username in PL/SQL
From: Gary O'Keefe <gary_at_onegoodidea.com>
Date: Thu, 26 Aug 1999 11:49:26 GMT
Message-ID: <37c5237c.10047470_at_news.hydro.co.uk>
end test;
Date: Thu, 26 Aug 1999 11:49:26 GMT
Message-ID: <37c5237c.10047470_at_news.hydro.co.uk>
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;
end test;
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 postReceived on Thu Aug 26 1999 - 13:49:26 CEST