Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2007
    Posts
    5

    Unanswered: Trigger when exit

    Hi

    I need to call a stored procedure automatically when the user exits out of the oracle session. Is there a trigger that I can use to do that.


    Thanks.

  2. #2
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    CREATE TRIGGER logoff_t ON LOGOFF
    BEGIN
    .....
    END;
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  3. #3
    Join Date
    Mar 2007
    Posts
    5
    Thanks for your reply.

    I also need to specify in the trigger that if a specific procedure is called then only trigger the logoff trigger. For example

    I have 2 procedures
    1) SP_BEGIN
    2) SP_END (this procedure will be called inside the trigger)

    I need to say that trigger the logoff trigger when the user logs off the oracle session ONLY IF the user has called the SP_BEGIN procedure.

  4. #4
    Join Date
    Dec 2003
    Posts
    1,074
    Probably need to set a package spec variable during SP_BEGIN, and then test the value of that variable in the body of the LOGOFF trigger. If it's an acceptable value, fire off the code in the trigger. Otherwise, exit it immediately.

    -cf

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •