I found the code for a row generator from this question Create View with 365 days
CREATE VIEW year_days (the_day) AS
SELECT TRUNC(SYSDATE, 'YYYY') + (LEVEL-1) AS the_day
FROM DUAL
CONNECT BY LEVEL <= TO_NUMBER(TO_CHAR(LAST_DAY(ADD_MONTHS(TRUNC(SYSDATE, 'YYYY'),11)), 'DDD'))
/
SELECT * FROM year_days
Since I don't have CREATE privileges, I modified it to an inline-query form :
SELECT
year_days.*
FROM
(
SELECT TRUNC(SYSDATE, 'YYYY') + (LEVEL-1) AS the_day
FROM DUAL
CONNECT BY LEVEL <= TO_NUMBER(TO_CHAR(LAST_DAY(ADD_MONTHS(TRUNC(SYSDATE, 'YYYY'),11)), 'DDD'))
) year_days
The inline-query code above works perfectly fine on one of our Oracle 11g R2 (v11.2.0.3.0) instance, as well as on Oracle's own LiveSQL (19c, v19.2.0.0.0).
However, it does not work on the instance that it needs to run on, which is 8i (v8.1.7.4.0). I get ORA-01436: CONNECT BY loop in user data.
At first glance it seems that 8i sees an infinite loop in that code, but not 11g and up. Why ?
Note: I know 8i is old. I have no control over that.