Using Oracle 11g release 2, the following query gives an ORA-01790: expression must have same datatype as corresponding expression:
with intervals(time_interval)
Odd - works if you pass around varchar
s and convert (not cast):
WITH intervals(time_interval) AS
(SELECT to_char(TRUNC(systimestamp))
FROM dual
UNION ALL
SELECT to_char(to_timestamp(time_interval) + numtodsinterval(10, 'Minute'))
FROM intervals
WHERE to_timestamp(time_interval) < systimestamp
)
SELECT to_timestamp(time_interval) time_interval
FROM intervals