Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Creating Triggers
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
![]() |
![]() |