RE: Login Trigger

  • From: "Jacques Kilchoer" <Jacques.Kilchoer@xxxxxxxxx>
  • To: <oracle-l@xxxxxxxxxxxxx>
  • Date: Thu, 20 May 2004 15:11:37 -0700

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@xxxxxxxxxxx

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@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: