Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: trigger?

Re: trigger?

From: Daniel A. Morgan <dmorgan_at_exesolutions.com>
Date: Thu, 17 May 2001 18:34:15 -0700
Message-ID: <3B047C17.F006A23B@exesolutions.com>

tony wrote:

> Hi. I want to create a trigger that will delete rows that are sysdate
> - 3 or older.
>
> Here's a select that returns the correct rows:
>
> select * from table_a
> where
> last_activity_date >= sysdate - 3
>
> Can anyone show me the syntax to cretate this trigger?
>
> TIA,
> tony

What you are describing is not a suitable usage for a trigger.

There are three basic trigger types, on insert, on update, and on delete. What event would you expect to set off this trigger? And do you understand that the trigger would fire each and every time this triggering event happened? And are you aware that you can not use a trigger to modify the table on which it is placed in the manner you indicate above?

At the very least, you need to indicate the relationship of the table the trigger is on with the table where the deletes will take place and the type of triggering event for anyone to help you.

Daniel A. Morgan Received on Thu May 17 2001 - 20:34:15 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US