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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Login Trigger

RE: Login Trigger

From: Jacques Kilchoer <Jacques.Kilchoer_at_quest.com>
Date: Thu, 20 May 2004 15:11:37 -0700
Message-ID: <B5C5F99D765BB744B54FFDF35F60262109F87861@irvmbxw02>


To set the login_name variable, do you even need to create a procedure? I usually do something like this:
create or replace package p
is

   my_login_name varchar2(30) ;
end p ;
/

create or replace package body p
is
begin

   my_login_name := user ;
end p ;
/

Then in PL/SQL code I reference p.my_login_name which is set the first time the package is invoked. (idea taken from Oracle PL/SQL Programming, Feuerstein / Pribyl)

-----Original Message-----
Jared.Still_at_radisys.com

What you're thinking of is package variables. Variables declared in the header of a package will persist until they are changed or the user logs out.

e.g.

create or replace package p
is

   my_login_name varchar2(30);

  procedure setname;

end;
/

create or replace package body p
is

  procedure setname
  is
  begin

     my_login_name := user;
  end;

end;
/

You can now reference p.my_login_name outside of the package.

Just call the proc from the login trigger.



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Thu May 20 2004 - 17:08:29 CDT

Original text of this message

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