I already have a table built in oracle. I'm trying to insert some data that looks like this:
But, I can't seem to be able to add the DATE together with the ID, YEAR and INDICATOR.
I manage to get the DATE from 1/1/2019 7:00:00 PM - 12/31/2019 7:00:00 PM.
CODE:
INSERT INTO TABLE(DATE)
select to_date('01-01-2019 7:00:00 PM', 'DD-MM-YYYY HH:MI:SS PM') + rownum -1 dt from dual
connect by level <= to_date('05-01-2019 7:00:00 PM', 'DD-MM-YYYY HH:MI:SS PM') -
to_date('01-01-2019 7:00:00 PM', 'DD-MM-YYYY HH:MI:SS PM') + 1;
When I exclude DATE, it looks like this:
CODE:
INSERT INTO TABLE (ID, YEAR, INDICATOR)
Values (sequ.nextval, '2019', 'X') ;
I tried to combine the two codes but it doesn't work. Is there any other ways I can do to make it works? Or I'm doing it the wrong way?
The only change data is the DATE because I need it to be 365 days of 2019.
YEAR and INDICATOR remain the same for all data.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…