Truncate table inside trigger(Urgent help needed)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jith87
    New Member
    • Jul 2007
    • 58

    Truncate table inside trigger(Urgent help needed)

    hi,
    how do you truncate a table inside a trigger(plsql) if the table size is more than 1000 records???
    regards,
    jith
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Try to use native dynamic sql (EXECUTE IMMEDIATE)

    also mark the trigger as pragma autonomous_tran saction;

    Comment

    • gintsp
      New Member
      • Aug 2007
      • 36

      #3
      Originally posted by debasisdas
      Try to use native dynamic sql (EXECUTE IMMEDIATE)

      also mark the trigger as pragma autonomous_tran saction;
      Just remember that pragma autonomous_tran saction and truncate is very dangerous tool. In case your main transaction is rolled back, truncated table will remain truncated anyway.

      Gints Plivna

      Comment

      Working...