I was wondering if someone can help me figure out how to code so that it will display the output without me having to use the command select * from month_days when I run the program.
set serveroutput on
--- Drop Table
DROP TABLE MONTH_DAYS;
--- Create Table
CREATE TABLE MONTH_DAYS(cnt number(2), Month_ Varchar(9),Days_ Number(2));
Declare
mons varchar2(10);
dats varchar2(10);
i Binary_integer := 0;
Begin
loop
i:= i+1;
if i = 13 then
exit;
end if;
insert into month_days(cnt, month_, days_)`enter code here`
values
(i, to_char(add_months(to_date('20200112', 'YYYYDDMM'), i), 'Month'),
to_char(last_day(add_months(to_date('20200112', 'YYYYDDMM'), i)), 'DD'));
end loop;
DBMS_Output.Put_Line('The Month and Days for the year 2020'||Month_|| ''||Days_);
end;