title: How to use checkbox in a report in oracle apex to insert values in a table
body: <p>I have a table call <strong>OUTGOING</strong> which has many fields but the ones to be populated in this situation is:</p>
  
  <ul>
  <li>FILENUMBER   </li>
  <li>OUTGOINGDATE </li>
  <li>DEPARTMENT  </li>
  </ul>
  
  <p>now i have a report which whas an sql   </p>
  
  <pre><code> SELECT APEX_ITEM.CHECKBOX2(1,registry.filenumber) "Select",
  
    INCOMINGREQUESTNOTIFICATION.REQUESTEDFILE as REQUESTEDFILE,
      INCOMINGREQUESTNOTIFICATION.FILENUMBER as FILENUMBER,
      INCOMINGREQUESTNOTIFICATION.REQUESTEDDEPARTMENT as REQUESTEDDEPARTMENT,
      INCOMINGREQUESTNOTIFICATION.REQUESTDATE as REQUESTDATE,
  
      REGISTRY.STATUS as STATUS 
   from REGISTRY REGISTRY,
      INCOMINGREQUESTNOTIFICATION INCOMINGREQUESTNOTIFICATION 
   where REGISTRY.FILENUMBER(+) =INCOMINGREQUESTNOTIFICATION .FILENUMBER
  and INCOMINGREQUESTNOTIFICATION.STATUS ='PENDING'
  </code></pre>
  
  <p>which is fine .. what i need is for </p>
  
  <ul>
  <li>INCOMINGREQUESTNOTIFICATION.FILENUMBER as FILENUMBER</li>
  <li>INCOMINGREQUESTNOTIFICATION.REQUESTEDDEPARTMENT as REQUESTEDDEPARTMENT</li>
  <li>and sysdate </li>
  </ul>
  
  <p>to be inserted in the outgoing table under the relevant names of course.</p>
  
  <p>I have a pl/sql </p>
  
  <pre><code> DECLARE
    L_FILENUMBER WWV_FLOW_GLOBAL.VC_ARR2;
  BEGIN
    L_FILENUMBER := APEX_APPLICATION.G_F01;
    FOR IDX IN 1 .. L_FILENUMBER.COUNT
    LOOP
      IF L_FILENUMBER(IDX) IS NOT NULL THEN
        INSERT INTO OUTGOING
       (FILENUMBER,OUTGOINGDATE,DEPARTMENT)
  
  VALUES
  ((to_number(APEX_APPLICATION.G_F01(1)))     
     ,SYSDATE
  ,to_char(APEX_APPLICATION.G_F02(2))  )
  
       ;
  
      END IF;
    END LOOP;
  END;
  </code></pre>
  
  <p>which is not working.. However if i leave only filenumber</p>
  
  <pre><code>DECLARE
    L_FILENUMBER WWV_FLOW_GLOBAL.VC_ARR2;
  BEGIN
    L_FILENUMBER := APEX_APPLICATION.G_F01;
    FOR IDX IN 1 .. L_FILENUMBER.COUNT
    LOOP
      IF L_FILENUMBER(IDX) IS NOT NULL THEN
        INSERT INTO OUTGOING
       (FILENUMBER)
  
  VALUES
  ((to_number(APEX_APPLICATION.G_F01(1)))     
  
       ;
  
      END IF;
    END LOOP;
  END;
  </code></pre>
  
  <p>its inserting only the file number fine . This is all being done via a submit button.   </p>
  
  <p>NB: i also tried putting outgoing date and department in the declare statement but it still doesnt work</p>
  
  <p><a href="https://i.stack.imgur.com/4eCAw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4eCAw.png" alt="enter image description here"></a></p>