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

Home -> Community -> Usenet -> c.d.o.server -> Re: Need a SQL expert help : How to create a trigger for DELETE ???????

Re: Need a SQL expert help : How to create a trigger for DELETE ???????

From: <bret_at_sybase.com>
Date: 1998/08/11
Message-ID: <6qq4ic$uil$1@nnrp1.dejanews.com>#1/1

In article <35D06821.56CD542E_at_sftw.umac.mo>,   d951686_at_sftw.umac.mo wrote:
> Hello,
>
> How can I create a TRIGGER for DELETE a record ?
>
> Such as, when I delete a record, it will auto copy this record to
> another TABLE ???
>
> Best regards,
> Eric

In Sybase SQL Server:

assuming your base table is MYTABLE and you want to copy deleted records to MYTABLE_ARCHIVE create trigger MYTABLE_DEL_TRIG on MYTABLE for delete as insert MYTABLE_ARCHIVE select * from deleted go

--
Bret Halford
Sybase, Inc.
3665 Discovery Drive
Boulder, CO 80303

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum
Received on Tue Aug 11 1998 - 00:00:00 CDT

Original text of this message

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