Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Problem with for loop: ApEX

Problem with for loop: ApEX

Problem with for loop: ApEX

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 = :P201_CLASS_ID

FOR i in 1..htmldb_application.g_f01.count
INSERT INTO Attendances(student_id, register_id)
VALUES(htmldb_application.g_f01(i), :P201_REGISTER);

Can anyone help?


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close