Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2004
    Posts
    8

    Question Unanswered: How to retrieve current session info in trigger?

    Can the trigger in 9i retrieve the info. of the session which fire the trigger?
    I need to specified which application fire the trigger and do different operation on it.
    Just like the above in SQL Server

    Code:
    create trigger TABLE_TRIGGER on DB..TABLE for insert,delete,update as 
    if app_name() != 'application name'
    begin
      .........
      .........
      .........
    end;
    Can it be done similarly in Oracle?

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    You can do this:
    Code:
    SQL> select module
      2  from v$session where audsid = userenv('sessionid');
    
    MODULE
    ------------------------------------------------
    SQL*Plus
    ... but don't rely on it for security.

Posting Permissions

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