Hi all,
I am trying to get the value of a checkbox (htmldb_item.checkbox(1, s.student_id) PRESENT) to determine if the database is updated. If the box is checked then it should write to the database once. If not then it should not do anything.
At the moment, it is writing twice if checked and once if not checked.
htmldb_application.g_f01 is a global variable where it stores the value of the checkbox.
select htmldb_item.checkbox(1, s.student_id) PRESENT,
s.student_id STUDENTID_L,
s.f_name FNAME_L,
s.s_name SNAME_L
from students s
where s.fclass_id = 201_CLASS_ID
DECLARE
BEGIN
FOR i in 1..htmldb_application.g_f01.count
LOOP
INSERT INTO Attendances(student_id, register_id)
VALUES(htmldb_application.g_f01(i), 201_REGISTER);
COMMIT;
END LOOP;
END;
Can anyone help?
Thanks.
I am trying to get the value of a checkbox (htmldb_item.checkbox(1, s.student_id) PRESENT) to determine if the database is updated. If the box is checked then it should write to the database once. If not then it should not do anything.
At the moment, it is writing twice if checked and once if not checked.
htmldb_application.g_f01 is a global variable where it stores the value of the checkbox.
select htmldb_item.checkbox(1, s.student_id) PRESENT,
s.student_id STUDENTID_L,
s.f_name FNAME_L,
s.s_name SNAME_L
from students s
where s.fclass_id = 201_CLASS_ID
DECLARE
BEGIN
FOR i in 1..htmldb_application.g_f01.count
LOOP
INSERT INTO Attendances(student_id, register_id)
VALUES(htmldb_application.g_f01(i), 201_REGISTER);
COMMIT;
END LOOP;
END;
Can anyone help?
Thanks.