how to specify when clause in a database trigger
439559Mar 7 2005 — edited Mar 7 2005
I would like to create a database trigger that only fires on database create statements. In particular, it only needs to fire when tables with a specific prefix fire.
I'd like to be able to specify something in the when clause along the lines of :
CREATE OR REPLACE
TRIGGER CAPTURE_STATS
after CREATE ON rtrei.schema
WHEN ( NEW.table_name like 'RT_FOO%' )
begin
add_stats_capture( :new.min_range, :new.max_range);
end;
/
It looks like I should be able to use a when as part of a database trigger, but I have no idea what new would be defined to be so that I could use it... perhaps it is an object and the clause would look something like
when (new.objecttype = 'TABLE' and new.name like 'RT_FOO%')?
Any ideas? I've searched through the docs, but have not been able to find anything relevant.
thanks very much,
Robin