Re: Triggers In Informix?
Posted in 1995
sh5@ornl.gov (Steve Huff) wrote:
>
>Two questions from a novice Informix programmer:
>
>
>1. Does Informix support the definition of database "triggers" to allow some
>defined activity (e.g. "update") on a column or row to automatically fire off
>some pre-defined code? If so, where can I find information about how to do
>this? I need to recalculate the value in one table every time one of the
>contributing values in another tables gets updated.
>
>2. Is there anyway that I can cause a SELECT statement to return every
>nth row from the rows satisfying the WHERE clause, where n is a parameter I
>specify at the time of SELECT? Or equally acceptable to return a random
>sample of size n% from the rows satisfying the WHERE clause?
>
Try the following:
SELECT ... FROM ... WHERE ... AND MOD(ROWID,n)=0
This is probably not very random, but it should give you a reasonably
well distributed sample of every nth row.
--
John H. Frantz Check out Power-4gl
Alive in Iceland! http://www.strengur.is/~frantz/pow4gl.html