SIRA_PRISE allows you to just declare that constraint in algebraic form, and SIRA_PRISE will enforce your constraint for you without you having to write any code what so ever.
Or, second-best option, you can write triggered code in some SQL system and hope you haven't made any mistakes/overlooked anything, but your chances for that are not so good. "Applied Mathematics for database professionals" has a whole chapter devoted to this very problem. Be in for quite a few aha-erlebnisses.
Or, third-best option, you can write application code to enforce your constraint and hope no one will ever make another application doing updates to your database and overlook the constraint (the chances of which are pretty high, because, honestly, where is the appropriate place that you can document the existence, let alone the formal specification, of your constraint ?). I haven't seen any great facilities for that in neither ER nor UML.