I have to fetch bulk record and insert into table using loop I have little confusion how to fetch and insert record using loop. Below I have shared what I have done so far .
declare
stud_Id varchar;
begin
stud_Id := select student_id from student_backup where is_active_flg ='Y';
for i in 1 ..stud_Id.count
loop
insert into users(student_id,password,status) values(stud_Id(i),'password','status')
where not exists (select student_id from users where student_id=stud_Id(i))
end loop;
commit;
end;
/