I have a procedure in which we are to insert the last 365 days as date starting from X into a table.
Currently the procedure is using LOOP [365 iterations] and inserting the data in 365 DML statements.
From my understanding using connect by loop and inserting all at once would be a better option in terms of performance.
Please find my query below where X = 30-SEP-2017:
insert into Temp_Table_X as
select (To_Date('30-SEP-2017','DD-MON-RRRR')+1) - rownum
from dual
connect by rownum <= 365
Please advise.