insert + trigger = is mutating table ?
Bonjour,
Je m'interroge sur la différence entre ces 2 bouts de codes ci-dessous.
Je précise qu'un trigger «before insert» est existant sur la table «pointnodepoint».
Lors de l'execution du premier, une exception «is mutating table» est levée, ce qui n'est pas le cas du 2ème.
Les verrous sur les tables ne sont-ils pas identiques pour ces 2 requêtes ?
Code:
1 2 3 4
| INSERT INTO pointnodepoint(entitycode, pointcoderef, indice)
SELECT p_PointCode, pointcoderef, indice
FROM pointnodepoint
WHERE entitycode = p_PointOriginCode; |
Code:
1 2 3 4
| for i in(SELECT p_PointCode, pointcoderef, indice FROM pointnodepoint WHERE entitycode = p_PointOriginCode)
loop
INSERT INTO pointnodepoint(entitycode, pointcoderef, indice) values(p_PointCode, i.pointcoderef, i.indice);
end loop; |
Merci.