Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: trigger?
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