9 Replies Latest reply on Feb 2, 2019 10:40 AM by Ramya-Oracle

    how to fetch data from the selected checkboxes in IR

    Ramya-Oracle

      Problem: I have an oracle apex page which has a report with columns as department names and employee names along with check boxes. Upon selecting the one or more check boxes and clicking on submit button following should happen.

      1. the pl/sql code should fetch the department names of all the selected rows from emp table.
      2. Next it should fetch employess names under each department for the selected checkboxes.

      how can we  accomplish this?

      Below is my code.

       
      FOR i in 1..APEX_APPLICATION.G_F01.count
      LOOP
         IF APEX_APPLICATION.G_F01(i) IS NOT NULL THEN
          FOR dept_names_REC IN (select dept_names from emp WHERE emp.ID =APEX_APPLICATION.G_F01(i) group by dept_names)
        LOOP
            FOR i in 1..APEX_APPLICATION.G_F01.count
            LOOP
                  IF APEX_APPLICATION.G_F01(i) IS NOT NULL THEN
                          select  listagg(emp_name,',') WITHIN GROUP (ORDER BY dept_name) into str_emp_names from emp where dept_name=dept_names_REC.dept_name and              emp.ID =APEX_APPLICATION.G_F01(i);
                   END IF;
              END LOOP;
               myCLOB:='';
                             myCLOB:=myCLOB||'java -jar test.jar -dept_name="'||dept_names_REC.dept_name||'" -emp_names="'||str_emp_names||'" 
                         
      
                     END;
        END LOOP;
      

       

       

         END IF;  

        END LOOP;

       

      END IF;  

        END LOOP;