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: Creating Triggers

Re: Creating Triggers

From: Jonathan Gennick <gennick_at_worldnet.att.net>
Date: 9 Oct 1998 02:14:16 GMT
Message-ID: <361f6c9f.14008677@netnews.worldnet.att.net>


On Wed, 07 Oct 1998 17:37:15 -0700, Nimat Haque <nha_at_ece2.engr.ucf.edu> wrote:

>Whenever a new row is inserted to table1, one field (for example SSN)
>value will be taken from the table and inserted to table2.

Something like this should work.

create or replace trigger on table1
after insert
for each row
is
begin
  insert into table2 (ssn) values (:new.ssn); end;
/

You should be able to execute the above from SQL*Plus. Don't forget the forward slash on the last line, in the first position. Also, try and get your hands on the SQL Reference manual, and look under CREATE TRIGGER. You will see more examples that might help.

Jonathan Received on Thu Oct 08 1998 - 21:14:16 CDT

Original text of this message

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