Home » RDBMS Server » Server Administration » DB_NAME
DB_NAME [message #118988] Tue, 10 May 2005 02:52 Go to next message
patrykp
Messages: 31
Registered: April 2005
Member
How migrate the code to Oracle?
SELECT DISTINCT DB_NAME(SYSP.dbid) dmname, SYSP.program_name, SYSP.loginame
FROM sysprocesses SYSP, test T
WHERE (T.User_ID = SYSP.uid_) AND
(
(DB_NAME(SYSP.dbid) = DB_NAME())
Best regards.
Re: DB_NAME [message #119059 is a reply to message #118988] Tue, 10 May 2005 08:20 Go to previous messageGo to next message
Frank Naude
Messages: 4587
Registered: April 1998
Senior Member
Try something like this:

SELECT DISTINCT SYS_CONTEXT('USERENV', 'DB_NAME') dmname,
       sysp.program, sysp.username
  FROM sys.v_$session sysp, test t
 WHERE t.user_id = sysp.audsid
/


Best regards.

Frank
Re: DB_NAME [message #119092 is a reply to message #119059] Tue, 10 May 2005 09:59 Go to previous message
patrykp
Messages: 31
Registered: April 2005
Member
Hi Frank,
thanks for the reply.

Best regards.
Patryk
Previous Topic: database not starting
Next Topic: Pb From Dedicated to Shared in Oracle9i R2
Goto Forum:
  


Current Time: Fri Jan 10 04:26:03 CST 2025