4 Replies Latest reply: Jan 14, 2013 7:19 AM by Joni Vandenberghe RSS

    update interactive report according to the filter of the user

    Naamas
      Hi all
      i'm working with Apex version 4.2/
      i have an interactive rport page as we know it allows the user to make filtering ans sorting
      I want to do as follow :
      i created an interactive report in table
      CREATE TABLE EMP
      (
        EMPNO     NUMBER(4)                           NOT NULL,
        ENAME     VARCHAR2(10 BYTE),
        JOB       VARCHAR2(9 BYTE),
        MGR       NUMBER(4),
        HIREDATE  DATE,
        SAL       NUMBER(7,2),
        COMM      NUMBER(7,2),
        DEPTNO    NUMBER(2)) 
      
      ALTER TABLE EMP ADD (
        PRIMARY KEY
       (EMPNO)
      now i've created a new region called update_all_region with two text field items.
      p30_sal  
      p30_deptno 
      and an update_all button .
      lets take a look at the scenario :
      lets say that the user doing sort on the IRR lets say give all the employees where the sal >10000.
      lets say that the report return 100 rows to the result , result per page : 50.
      now i'm entering in the update_all_region text field item the values :
      p30_sal : 90000 
      p30_deptno : 30 and pressing the update_all button .
      i want that all the rows which appears in the report (total = 100) will be update.
      i've tried to do this :
      begin
      FOR i IN 1..APEX_APPLICATION.G_F02.COUNT 
      LOOP
       update emp
        set salary =  :p30_salary , 
        deptno= :p30_deptno
       where employee_id  = apex_application.g_f02(i);
      END LOOP;
      commit;
      end;
      problem :
      this update only updates the 50 rows in the current page that i'm in it. and not the all 100 .
      question :
      is this the correct way to do this update , form whatt i've understood , i can take the object filter as a variable , and use it in order to update the table.
      please you advice
      Thanks In Advanced
      Naama