SELECT MAX(class_id) FROM classes;
-Execute and see the result=6;

CREATE SEQUENCE class_id_sec_car
 START WITH 7
 INCREMENT BY 1
 NOCACHE;


DECLARE
v_new_class_no integer:= NVL(:no_of_new_classes,1);
v_c_id classes.course_id%type:=:course_id;
v_period classes.period%type:=:period;
v_f classes.frequency%type:=:frequency;
v_i classes.instr_id%type:=:instr_id;
BEGIN
for i in 1..v_new_class_no 
loop
insert into classes (class_id, start_date,course_id,period,frequency,instr_id)
values (class_id_sec_car.nextval,sysdate,v_c_id,v_period,v_f,v_i);
commit;
end loop;
END;


