Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create trigger problem
Message
Information générale
Forum:
Oracle
Catégorie:
Déclencheurs, séquences et procédures stockées
Divers
Thread ID:
00624319
Message ID:
00624579
Vues:
11
>Hi guys,
>
>I need to create a very simple trigger, but i am getting an error. :(
>
>The trigger must do the following: when a record is updated on table X, it must be also inserted into another table called Y, that has the same structure that table X plus a varchar2(10) field.

Off the top of my head ...


CREATE OR REPLACE Trigger myTrigger
BEFORE INSERT OR UPDATE ON X
FOR EACH ROW
BEGIN
insert into y (columname) values (:new.columname);
COMMIT;
--don't know if you need commit or not (can't remember..)
END;
/
SHO ERR

Can get trickier if you need to rollback transactions for example on the y table when an error occurs on the x table.

Otherwise post you code and error.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform