Can an Oracle trigger be disabled for the current session?

前端 未结 4 1146
日久生厌
日久生厌 2021-02-19 16:28

I\'d like to disable a specific trigger on a table prior to inserting data into it, but without affecting other users that may be changing data in that same tab

4条回答
  •  一个人的身影
    2021-02-19 17:27

    I dont think that disabling trigger is possible for a particular session is possible in oracle or other rdbms .

    My solution is that ,if you know the CURRENT_USER or the session_id from which you login ,than you can put a condition in the trigger .

      IF SYS_CONTEXT ('USERENV', 'CURRENT_USER') <> '' THEN
        --do the operation
    
      END IF; 
    

    This condition you need to put in your trigger

提交回复
热议问题