This documentation is for the unreleased development version of jOOQ. Click on the above version links to get this documentation for a supported version of jOOQ.
Events
Applies to ❌ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
Most dialects supporting triggers can fire ...
-
BEFORE
-
AFTER
-
INSTEAD OF
... a certain event, including ...
-
INSERT
-
UPDATE
-
DELETE
Note that the above refer to events, not the statements, meaning that a trigger may fire also for the MERGE statement.
Some examples illustrating possible triggers:
create.createTrigger("trg1") .beforeInsert() .on(BOOK) .forEachRow() .as(insertInto(LOG).columns(LOG.TEXT).values("Row inserted in BOOK")) .execute(); create.createTrigger("trg") .beforeUpdate() .on(BOOK) .forEachRow() .as(insertInto(LOG).columns(LOG.TEXT).values("Row updated in BOOK")) .execute(); create.createTrigger("trg") .beforeDelete() .on(BOOK) .forEachRow() .as(insertInto(LOG).columns(LOG.TEXT).values("Row deleted in BOOK")) .execute(); create.createTrigger("trg") .beforeInsert().orUpdate().orDelete() .on(BOOK) .forEachRow() .as(insertInto(LOG).columns(LOG.TEXT).values("Row inserted or updated or deleted in BOOK")) .execute();
Feedback
Do you have any feedback about this page? We'd love to hear it!