Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: materilized view maintenance
"Loki" <rinze_cats_at_hotmail.com> writes:
> 2. What would this trigger look
> like in PL/SQL?
A trigger that fires every 100 rows ? Tricky. Needs to have some sort of memory.
This could basically work:
You original table gets a column "sequence_num" that gets incrementd with every insertion. Chances are, you already have such a column. When you refresh your materialized view you have to remeber the last sequence_num that made it SOMWHERE. I think the only possible place is another database table, because anything session specific won't do.
Whenever you isert a new row, the trigger would compare the current sequence_num with SOMEWHERE.sequence_num and if the two are more than 100 apart, triggers the refresh of the M.V. Received on Tue Apr 10 2001 - 14:56:30 CDT
![]() |
![]() |