Re: pl/sql triggers

From: Jan <parsekan_at_hotmail.com>
Date: 29 Oct 2001 02:55:07 -0800
Message-ID: <2bb86e9c.0110290255.9cf557d_at_posting.google.com>


write a before update trigger which checks the report_date against sysdate, if the substract is greater than 7 days return -1 to stop update and send the frontend a message.

Jan

Frank van Bortel <fbortel_at_home.nl> wrote in message news:<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 ;-)
Received on Mon Oct 29 2001 - 11:55:07 CET

Original text of this message