Forum Stats

  • 3,839,819 Users
  • 2,262,538 Discussions
  • 7,901,063 Comments

Discussions

Exception in a Trigger???

vijz
vijz Member Posts: 682
edited Dec 31, 2008 6:23PM in SQL & PL/SQL
Hi Guru's,

Can we handle exceptions in Triggers?

Thanks

Edited by: user10679113 on Dec 31, 2008 1:29 PM
Tagged:

Answers

  • Frank Kulash
    Frank Kulash Member, Moderator Posts: 42,261 Red Diamond
    Hi,

    Sure.
    But don't take my word for it. Try it and see.
  • Himanshu Kandpal
    Himanshu Kandpal Member Posts: 1,971 Silver Badge
    What type of exception do you want to capture in a trigger ?
    This link can help you..
    http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/triggers.htm

    thanks
  • 439427
    439427 Member Posts: 230
    Sure you can. Imp point to take note of

    # If you use a LOGON trigger to monitor logons by users, include an exception-handling part in the trigger, and include a WHEN OTHERS exception in the exception-handling part. Otherwise, an unhandled exception might block all connections to the database.

    # If you use a LOGON trigger only to execute a package (for example, an application context-setting package), put the exception-handling part in the package instead of in the trigger.
This discussion has been closed.