Create a Trigger to insert data from 1 table to another....
Posted on 2007-10-17
I am trying to create a trigger that works after the insert of a record on one table; then goes to another table grabs data for the matching key column and inserts it into a 3rd table to create a new record. The tables are spaital but that shouldn't have any bearing on this. My insert statement works on it's own. Here's my code:
CREATE OR REPLACE TRIGGER TITLE_ABSTRACT_CREATE
insert on abstract_pins
for each row
insert into sp_title_abstracts (GID,GEOM_AREA,COMMENTS,TAG_X,TAG_Y,TAG_VALUE,TAG_SIZE,TAG_ANGLE,TAG_JUST,GEOMETRY,PIN,PRCL_GID)
select munseq_gid.nextval,GEOM_AREA,COMMENTS,TAG_X,TAG_Y,TAG_VALUE,TAG_SIZE,TAG_ANGLE,TAG_JUST,GEOMETRY,a.PIN,GID from sp_prcl b, abstract_pins a
where a.pin = B.PIN;
All help is greatly appreciated.