My database schema has a 'locked' setting meaning that the entry can not be changed once it is set.
Before the locked flag is set we can update other attributes. So:
- Would you check the locked flag in code and then update the entry
or
- would it be better to combine that into a SQL query, if so, any examples?
EDIT: how would you combine the update & check into one SQL statement?