Loading topic
IF, exceptions). It also assumes you know what a sequence is and how COMMIT and ROLLBACK work. The previous chapters explained what a trigger is and how timing and level combine. Here you write one, read its syntax 5 min readCREATE OR REPLACE TRIGGER syntax from the previous chapter. You should also know the difference between statement-level and row-level triggers. Correlation values exist only in row-level triggers, so every trigger here uses `5 min read:OLD and :NEW, and use IF statements in PL/SQL. You should also know that a trigger's DML runs inside the transaction of the statement that fired it.5 min readCREATE OR REPLACE TRIGGER and that you can read :OLD and :NEW values. It uses the employees table from earlier chapters.5 min read:OLD and :NEW in earlier chapters. Here you will use BEFORE row triggers for two jobs: rejecting bad data and filling in columns the caller did not supply.5 min read:OLD and :NEW, and use the INSERTING, UPDATING, and DELETING predica5 min read:OLD and :NEW, and understand transactions. You will learn why some views reject DML, how an INSTEAD OF trigger fixes that, and which mistakes to avoid.5 min read:NEW and :OLD, and run PL/SQL in SQL*Plus or SQL Developer with SET SERVEROUTPUT ON. It covers two questions. In what order do triggers on one table fire for a single DML statement? How do you control that order when several5 min read:OLD and :NEW, and that you know how COMMIT, ROLLBACK, and savepoints work in a session. It covers why a trigger cannot end a transaction, what that means for audit rows, and how an autonomous transaction lets a trigger write data th5 min read:OLD and :NEW. It also assumes you understand transactions and basic PL/SQL exception handling. You will see what ORA-04091 means, which triggers raise it, and how to design around it. The fix with a compound trigger is covered in the6 min read:OLD and :NEW work, and you have seen ORA-04091 before. It covers the compound trigger, which lets row-level and statement-level logic share state. That shared state is the standard fix for ORA-04091.5 min readRAISE_APPLICATION_ERROR, and know that a trigger body cannot normally COMMIT. The earlier chapters covered triggers on tables and views. Here the trigger fires on something other than a row change: a DDL statement s4 min reademployees table and the employees_aud trigger from the audit chapter.5 min read:OLD and :NEW, the mutating table error, compound triggers and the transaction rules. Here we pull them into working rules and look at the mistakes that cause most trigger problems in production.6 min read