how to define such a trigger....

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • uwcssa@gmail.com

    how to define such a trigger....

    is it possible to define such a trigger on a table that once the table
    is X megabyte, or the has over 10000 records, the table is purged?

    thanks a lot
  • --CELKO--

    #2
    Re: how to define such a trigger....

    >is it possible to define such a trigger on a table that once the table is X megabyte, or the has over 10000 records [sic:rows are not records], the table is purged? <<

    CREATE TRIGGER Flush_at_10K_Ro ws
    AS ..
    IF (SELECT COUNT(*) FROM Foobar) >= 10000
    THEN DELETE FROM Foobar
    END IF;

    I cannot think of a good way to look at the physical file size, which
    different from the row count.

    Comment

    • Frederik

      #3
      Re: how to define such a trigger....

      I cannot think of a good way to look at the physical file size, which
      different from the row count.
      Perhaps you could do something with the sysibmadm.snapt ab view.

      Comment

      Working...