Unix Technical Forum

how to define such a trigger....

This is a discussion on how to define such a trigger.... within the DB2 forums, part of the Database Server Software category; --> is it possible to define such a trigger on a table that once the table is X megabyte, or ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-13-2008, 02:58 PM
uwcssa@gmail.com
 
Posts: n/a
Default 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-13-2008, 02:58 PM
--CELKO--
 
Posts: n/a
Default 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_Rows
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-13-2008, 02:58 PM
Frederik
 
Posts: n/a
Default 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.snaptab view.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:27 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com