Please publish sample/test data in one of the format of
(1) DDL and INSERT statement.
or
(2) WITH common-table-expression.
Anyway, try an INSERT statement something like this(not tested)
Code:
INSERT INTO horse_events
SELECT new_id , new_from_date , new_to_date , new_time
FROM sysibm.sysdummy1
WHERE NOT EXISTS(
SELECT 0
FROM horse_events h
WHERE h.id = new_id
AND h.from_date < new_to_date
AND h.to_date > new_from_date
AND h.time = new_time
)
;