Home » SQL & PL/SQL » SQL & PL/SQL » Regarding Exchange of column value between module and program column using trigger (Oracle Database 10g 10.2.0.1.0,Linux 2.6.9-55.0.9.ELsmp)
Regarding Exchange of column value between module and program column using trigger [message #398348] Thu, 16 April 2009 01:42 Go to next message
vinniora
Messages: 56
Registered: October 2008
Location: Mumbai
Member
In this trigger below
CREATE OR REPLACE TRIGGER BLOCK_TOOLS_FROM_PROD_1
AFTER LOGON
ON DATABASE
DECLARE
v_module varchar2(50);
v_terminal V$SESSION.terminal%TYPE;
v_username V$SESSION.username%TYPE;
BEGIN
SELECT terminal,username,MODULE INTO v_terminal,v_username,v_module
FROM sys.V$SESSION
WHERE audsid = USERENV('SESSIONID')
and audsid != 0 -- Don't Check SYS Connections
AND ROWNUM = 1; -- Parallel processes will have the same AUDSID's

INSERT INTO sys.info_1
VALUES(v_terminal,v_username,v_module);

END;
(info_1 contains three column terminal,username,module)
as when i execute a query
select * from info_1
i am getting the value of module as program column value from v$session
that is module value is toad.exe but it should come TOAD8.6.0.38

but when i execute a query as select terminal,program ,username,module from v$session it is showing

xyz toad.exe SCOTT TOAD8.6.0.38


why is this happening please help me out.thnx in advance

[Updated on: Thu, 16 April 2009 01:46]

Report message to a moderator

Re: Regarding Exchange of column value between module and program column using trigger [message #398392 is a reply to message #398348] Thu, 16 April 2009 02:43 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Module is set by toad itself AFTER logon successfully returned.

Regards
Michel
Re: Regarding Exchange of column value between module and program column using trigger [message #398416 is a reply to message #398392] Thu, 16 April 2009 03:41 Go to previous messageGo to next message
vinniora
Messages: 56
Registered: October 2008
Location: Mumbai
Member
But i have also tried sqlplus but it is still showing same value for module column as program column value as
sqlplus.exe rather it should be sql*plus as reult shown by the query select terminal,program,username,module from v$session
xyz sqlplus.exe scott sql*plus
Re: Regarding Exchange of column value between module and program column using trigger [message #398417 is a reply to message #398416] Thu, 16 April 2009 03:48 Go to previous message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Copy and paste what you did and what you got, do not describe it.

Before please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter), use code tags and align the columns in result.
Use the "Preview Message" button to verify.

Regards
Michel
Previous Topic: How to pass an array to an Procedure
Next Topic: Inserted Data not shown in the Table
Goto Forum:
  


Current Time: Sun Dec 04 06:17:11 CST 2016

Total time taken to generate the page: 0.08898 seconds