9 Replies Latest reply: Dec 14, 2012 2:37 AM by Gus C RSS

    Update Collection

    Gus C
      Apex 4.2

      I have a page which is simply
      create collection - before header process
      BEGIN
            IF apex_collection.collection_exists
                                           (p_collection_name      => 'JOB_PARAMETER')
            THEN
               apex_collection.delete_collection
                                           (p_collection_name      => 'JOB_PARAMETER');
            END IF;
       
            apex_collection.create_or_truncate_collection ('JOB_PARAMETER');
       
            FOR rec IN (select parameter
            ,value_char
            ,value_number
            ,value_date
            ,param_set
            ,param_type      
      from etl_job_param
      where system=:P6_SYSTEM
        and config=:P6_CONFIG
        and jobname=:P6_JOBNAME
        and param_set ='SUPPORT')
            LOOP
               apex_collection.add_member (p_collection_name      => 'JOB_PARAMETER',
                                           p_generate_md5         => 'NO',
                                           p_c002                 => rec.parameter,
                                           p_c003                 => rec.value_char,
                                           p_c004                 => rec.value_number,
                                           p_c005                 => rec.value_date,
                                           p_c006                 => rec.param_set,
                                           p_c007                 => rec.param_type
                                           );
            END LOOP;
         --
      
      -- Insert seq_id
         FOR rec IN (SELECT ac.seq_id
                       FROM apex_collections ac
                      WHERE ac.collection_name = 'JOB_PARAMETER')
         LOOP
            apex_collection.update_member_attribute
                                         (p_collection_name      => 'JOB_PARAMETER',
                                          p_seq                  => rec.seq_id,
                                          p_attr_number          => 1,
                                          p_attr_value           => rec.seq_id
                                         );
         END LOOP;
      
      END;
      The report on the collection
      select apex_item.display_and_save(1,c001) seq_id, 
      apex_item.display_and_save(2,c002) ||
      APEX_ITEM.MD5_CHECKSUM(c002,c003,c004,c005,c006) parameter
            ,APEX_ITEM.TEXT(3,c003,30,128) value_char
            ,APEX_ITEM.TEXT(4,c004) value_number
            ,APEX_ITEM.DATE_POPUP2(5,c005,'DD.MM.YYYY',15,11) value_date
            ,apex_item.display_and_save(6,c006) param_set
            ,apex_item.display_and_save(7,c007) param_type
      FROM     apex_collections
      WHERE collection_name = 'JOB_PARAMETER'
      All columns are set to standard report
      The create and the report work fine.
      My problem is that my update does not work.
      The process is set to On Submit Before Computations and Validations
      and linked to the Submit button.
      I also have a branch linked to the submit button
      DECLARE
      
      BEGIN
      
       FOR i IN 1 .. apex_application.g_f01.COUNT LOOP
      apex_debug.log_message(i||':'||wwv_flow.g_f01(i));
         apex_collection.update_member 
      (p_collection_name => 'JOB_PARAMETER',
       p_seq             => apex_application.g_f01 (i), -- Sequence ID
       p_c002            => apex_application.g_f02 (i), -- parameter
       p_c003            => apex_application.g_f03 (i), -- value_char
       p_c004            => apex_application.g_f04 (i), -- value_number
       p_c005            => apex_application.g_f05 (i), -- value_date
       p_c006            => apex_application.g_f06 (i), -- param_set
       p_c007            => apex_application.g_f07 (i) -- param_type
       );
       END LOOP;
      END;
      When I click the submit button I get the success message but nothing is updated.
      I have checked the collection via the session link on the dev tool bar, no update there either.
      I have inspected the report with firebug. All looks ok.
      Ran debug everything looked ok, except there was nothing displayed for my
      apex_debug.log_message(i||':'||wwv_flow.g_f01(i));
      Cheers

      Gus

      Edited by: Gus C on Dec 13, 2012 5:59 AM