4 Replies Latest reply: Jun 19, 2013 3:27 PM by GhanaApexDeveloper RSS

    Apex_collection on public page

    guyenko
      Hello,

      I am trying to create a collection from query.

      Created page redering process(on load before header)

      --code


      Begin
      APEX_COLLECTION.CREATE_OR_TRUNCATE_COLLECTION(
      p_collection_name => 'Customer_Usage');

      for x in (select captured_date, software_product, software_version, client_user, client_machine, client_initialized_date
      from customer_details where to_char(captured_date) = to_char(get_last_captured_date);
      loop
      apex_collection.add_member(p_collection_name => 'Customer_Usage',
      p_d001 => x.captured_date,
      p_c001 => x.software_product,
      p_c002 => x.software_version,
      p_c003 => x.client_machine,
      P-d004 => x.client_initialized_date
      );

      end loop;

      End;

      Error ' cannot insert into apex_040200.wwv_flow_collections$.user_id'.


      Oracle 11.2.0.3
      Apex 4.2 with apex listener 2.0 and Apache tomcat 6.0
      The session user_id = 'Nobody';


      Any help will be appreciated.

      Ivan

      Edited by: guyenko on Jun 6, 2013 8:42 AM

      Edited by: guyenko on Jun 6, 2013 8:44 AM

      Edited by: guyenko on Jun 6, 2013 8:45 AM
        • 1. Re: Apex_collection on public page
          NoGot
          Can reproduce this problem at apex.oracle.com?

          I tried application at apex.oracle.com, but i received no errors.
          • 2. Re: Apex_collection on public page
            guyenko

            NoGot,

             

            Was the collection created? Why am I receiving this error? Any clues?

             

            Thank you,

             

            Guyenko

            • 3. Re: Apex_collection on public page
              guyenko

              created a global page and added an application level process.

               

               

               

              begin
               if V('APP_USER') = 'nobody' then 
               apex_custom_aut.set_user('your substituion string');
               end if;
               end;
              
              
              

              After that, I was able to create the collection.

               

              Guyenko

              • 4. Re: Apex_collection on public page
                GhanaApexDeveloper

                HI guyenko,

                guyenko wrote:

                 

                NoGot,

                 

                Was the collection created? Why am I receiving this error? Any clues?

                 

                Thank you,

                 

                Guyenko

                 

                Your code looks clean , however the collection might have been inserted . you can use this small code snippet i created to check if  items do exist in the collection.

                 

                declare

                  v_workspace_id apex_workspaces.workspace_id%type;

                begin

                  select workspace_id

                    into v_workspace_id

                    from apex_workspaces

                   where workspace = '&WORKSPACE_NAME';

                  

                   -- Set Workspace ID

                   apex_util.set_security_group_id(v_workspace_id);

                 

                 

                   -- Set Application ID

                   apex_application.g_flow_id  := &APP_ID;    

                  

                   -- Set Session ID

                   apex_application.g_instance := &APP_SESSION; 

                end;

                Hope this helps.