From: Date: April 16 2003 4:46pm Subject: RE: Can I get username? List-Archive: http://lists.mysql.com/maxdb/14466 Message-Id: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C30426.ED025FD0" This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C30426.ED025FD0 Content-Type: text/plain; charset="koi8-r" Surkov wrote: > Can I get current database user name, his usergroup and his host name from > stored procedure? database user name can be asked using USER usergroup name using USERGROUP (for example select user, usergroup into :u1, :u2 from dual) The machine the database is working on can be asked with select SERVERNODE from DOMAIN.USERS where USERNAME = USER The machine your application is working on can be select with SELECT APPLNODEID FROM SYSDBA.TRANSACTIONS T, DOMAIN.CONNECTPARAMETERS C WHERE T.SESSION = C.SESSION Elke SAP Labs Berlin ------_=_NextPart_001_01C30426.ED025FD0 Content-Type: text/html; charset="koi8-r" Content-Transfer-Encoding: quoted-printable
Surkov =20 wrote:
 
> Can I get current database user = name, his=20 usergroup and his host name from
> stored procedure? 
&nb= sp;
database user name can be = asked using=20 USER
usergroup name using=20 USERGROUP
(for example select user, = usergroup=20 into :u1, :u2 from = dual)
&nb= sp;
The machine the database = is working on=20 can be asked = with 
select SERVERNODE from = DOMAIN.USERS=20 where USERNAME=20 =3D USER
&nb= sp;
The machine your = application is=20 working on can be select=20 with
SELECT APPLNODEID FROM=20 SYSDBA.TRANSACTIONS=20 T,
           =            =20 DOMAIN.CONNECTPARAMETERS C
WHERE T.SESSION =3D=20 C.SESSION
&nb= sp;
Elke
SAP Labs=20 Berlin
------_=_NextPart_001_01C30426.ED025FD0--