Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > Oracle
|
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 7th, 2007, 05:10 AM
Registered User
 
Join Date: Nov 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Trace logoff error

I have a logoff trigger that trace my program logout.
If an user close correctly the program the trigger trace the logout.
If the program crash the logout isn't written.

The trigger (and table to write) is on sys.

CREATE OR REPLACE TRIGGER logoff_audit_trigger
BEFORE LOGOFF ON DATABASE
DECLARE
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
update
   stats$user_log
set
   logoff_day = sysdate
where
   sys_context('USERENV','SESSIONID') = session_id;
update
   stats$user_log
set
   logoff_time = to_char(sysdate, 'hh24:mi:ss')
where
   sys_context('USERENV','SESSIONID') = session_id;
update
stats$user_log
set
elapsed_minutes =
round((logoff_day - logon_day)*1440)
where
sys_context('USERENV','SESSIONID') = session_id;
COMMIT;
END;
/








Similar Threads
Thread Thread Starter Forum Replies Last Post
LogOff problem in Page aliirfan84 ASP.NET 2.0 Professional 2 May 6th, 2007 04:56 PM
Server sent email requires client logoff - why? VictorVictor ASP.NET 2.0 Professional 6 April 11th, 2007 09:50 AM
Logoff User Help ali786 Classic ASP Databases 1 March 31st, 2005 01:27 PM
Logoff user using ASP: ali786 Classic ASP Databases 5 March 21st, 2005 12:34 PM
How Do I Restart MySQL After Logoff/Logon spjewett Beginning PHP 6 March 29th, 2004 04:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.