Reputation: 11
By using trigger I want to copy new added record to another table. I use the follow trigger but it is not bringing values from new added row.
ALTER TRIGGER "SalesTRG" after insert on DBA.SalesTransaction_Archive REFERENCING NEW AS new_salestransaction for each row WHEN ( new_salestransaction.LocCreatedClientNumber = '0001' ) BEGIN insert into SalesFG(TransactionNumbers) select TransactionNumber from new_salestransaction END
Thankx in advance
Upvotes: 1
Views: 367
Reputation: 10
the insert inside your trigger should look like:
insert SalesFG(TransactionNumbers) values(new_salestransaction.TransactionNumber)
Be aware, the trigger will be fired only when you insert new record with LocCreatedClientNumber = '0001'
Upvotes: 0