As Kevin said in his answer, you can configure the database trigger so that someone does not insert more than one row where the valid up to date is NULL .
SQL statement that validates this condition:
SELECT COUNT(*) FROM TABLE WHERE valid until IS NULL;
If the counter is not 1, your table has problems.
A process that adds a row to this table should do the following:
- Find the line where the value is valid until
NULL - Update validity to value before current date or any other significant date
- Insert a new line with a valid value up to
NULL
Gilbert le blanc
source share