Plsql trigger inserting deleting updating
Trigger is invoked by Oracle engine automatically whenever a specified event occurs.
Trigger is stored into database and invoked repeatedly, when specific condition match.' customers updated '); END IF; END; / Old salary: 20000 New salary: 25000 Salary difference: 5000 Old salary: 22000 New salary: 27000 Salary difference: 5000 Old salary: 24000 New salary: 29000 Salary difference: 5000 Old salary: 26000 New salary: 31000 Salary difference: 5000 Old salary: 28000 New salary: 33000 Salary difference: 5000 Old salary: 30000 New salary: 35000 Salary difference: 5000 6 customers updated Note: As many times you executed this code, the old and new both salary is incremented by 5000 and hence the salary difference is always 5000.
END BEFORE STATEMENT; BEFORE EACH ROW IS BEGIN NULL; -- Do something here.
END BEFORE EACH ROW; AFTER EACH ROW IS BEGIN NULL; -- Do something here.END AFTER EACH ROW; AFTER STATEMENT IS BEGIN NULL; -- Do something here.END AFTER STATEMENT; END The following code creates a test table and a compound trigger that fires for each timing point associated with insert, update and delete statements.We can create a trigger to update the 'product_price_history' table when the price of the product is updated in the 'product' table.