5 ms·
If you're ever thinking of writing a trigger for any purpose, think again. And again. They are used improperly far more often than not. Things should not ha
by ams6110 15y ago
If you're ever thinking of writing a trigger for any purpose, think again. And again. They are used improperly far more often than not. Things should not happen as "magic" side effects in a database, which is what triggers do. Generally better to be explicit with code in a function or stored procedure.
- empthought 15y agoIn general I disagree, but in this specific case you are right that a procedural interface to manipulating books/chapters is preferable. Essentially if your API is single-table DML, then triggers are preferable. If multiple tables need to be manipulated at the same time to complete the full operation, then there should be a procedural API and triggers are likely unnecessary.