Re: pl/sql triggers

From: Frank van Bortel <fbortel_at_home.nl>
Date: Thu, 11 Oct 2001 20:19:41 +0200
Message-ID: <3BC5E2BD.540F9168_at_home.nl>


riggers wrote:
>
> I have a table:
> create table crime_report (
> incident_id char (4) not null,
> crime_locality char (15) not null,
> crime_date date not null,
> report_date date not null,
> cost_of_crime numeric (8,2),
> officer_id char (4) not null,
> person_id char (4) not null,
> crime_id char (4) not null,
> primary key (incident_id),
> foreign key (officer_id) references police_office(officer_id),
> foreign key (person_id) references person(person_id),
> foreign key (crime_id) references crime(crime_id))
> cluster csr_report_charge(incident_id);
>
> Now I need to create a trigger that checks that crime_reports are not
> modified if more than a week has passed since the crime was reported.
>
> I've been trying for days and just can't work it out (yes a newbie).
> Any help would be much appreciated.
>
> thanks
> riggers

A trigger is something that needs to be triggered (hence the name...). If crime_reports are not modified, nothing happens (or triggers), so no trigger
will ever fire.
What you need is a procedure that checks periodically. Or a smarter reader ;-)

-- 
Gtrz,

Frank van Bortel
Received on Thu Oct 11 2001 - 20:19:41 CEST

Original text of this message