Xref: alice comp.databases.oracle.misc:39581 comp.databases.oracle.tools:30878
Path: alice!news-feed.fnsi.net!news.maxwell.syr.edu!newsfeed.icl.net!newspeer.clara.net!news.clara.net!remarQ-uK!remarQ.com!supernews.com!tank.news.pipex.net!pipex!tube.news.pipex.net!pipex!IntranetL5.hydro.co.uk!161.12.23.54
From: gary@onegoodidea.com (Gary O'Keefe)
Newsgroups: comp.databases.oracle.misc,comp.databases.oracle.tools
Subject: Re: Username in PL/SQL
Date: Thu, 26 Aug 1999 11:49:26 GMT
Organization: One Good Idea Ltd
Lines: 39
Message-ID: <37c5237c.10047470@news.hydro.co.uk>
References: <7q2pr6$ibs$1@zonnetje.nl.uu.net>
Reply-To: gary@onegoodidea.com
X-Trace: soap.pipex.net 935667951 15580 194.129.147.1 (26 Aug 1999 11:45:51 GMT)
X-Complaints-To: abuse@uk.uu.net
NNTP-Posting-Date: 26 Aug 1999 11:45:51 GMT
X-Newsreader: Forte Free Agent 1.11/32.235

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@onegoodidea.com

You know the score - my current employer has nothing to do with what I post
