Hi.
Please post your questions in the correct forum. This is not a suggestion/comment, it is a development issue, so it should be posted there. I've moved it to the relevant location.

To your issue...
You have the correct idea as far as the trigger go, but you need to be able to commit the changes and this requires that you make the code an autonomous transaction.
http://www.oracle-base.com/articles/mis ... ctions.phpYou would be better off putting your code into a package like this:
- Code: Select all
CREATE OR REPLACE PACKAGE system_triggers_pkg AS
PROCEDURE logon;
PROCEDURE logoff;
END system_triggers_pkg;
/
CREATE OR REPLACE PACKAGE BODY system_triggers_pkg AS
PROCEDURE logon IS
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
INSERT INTO ....
COMMIT;
END logon;
PROCEDURE logoff IS
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
UPDATE ....
COMMIT;
END logoff;
END system_triggers_pkg;
/
When you have coded your package to do the relevant inserts and updates, you can create your triggers.
- Code: Select all
CREATE OR REPLACE TRIGGER logon_trg
AFTER LOGON ON SCHEMA
CALL system_trigger_pkg.logon;
/
CREATE OR REPLACE TRIGGER logoff_trg
BEFORE LOGOFF ON SCHEMA
CALL system_trigger_pkg.logoff;
/
Remember, the logoff trigger will only fire if the session disconnects properly. If a connection dies or is killed it will not fire.
If you are still having problems, can you be more specific and post error messages. Say thing like, "but it doesnt seems to be working for me" is rather vague.

Cheers
Tim...