Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Username in PL/SQL

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@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 post Received on Thu Aug 26 1999 - 06:49:26 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US