Collections - member update attributes

APEX 4.2.2

Suppose I have a collection of APEX allows to store additional data specific to a session for some elements. N001 stores the primary key of the database record. CXXV attributes store session-specific data.

How can I do to update the specific values in the collection based on the primary key? All the API update in the package APEX_COLLECTION with the p_seq not work with our own data. Basically I want something equivalent to
update collection set c001=<value>, c002=<value> where n001=<pk>; if (sql%rowcount=0) then create the n001,c001,c002,... collection member
Any ideas? Thank you

Hello Elizabeth,.

I guess you can write something like this:

declare
  l_seq_id number := null;

begin
  select seq_id
  into l_seq_id
  from apex_collections
  where collection_name = 'YOUR_COLLECTION_NAME'
  and n001 = ;

  if l_seq_id is null then -- new
    apex_collection.add_member(
      p_collection_name => 'YOUR_COLLECTION_NAME',
      p_c001            =>
      ...
    );

  else -- update
    apex_collection.update_member(
      p_collection_name => 'YOUR_COLLECTION_NAME',
      p_seq             => l_seq_id,
      p_c001            =>
      ...
    );
end;

Thank you

Erick

Tags: Database

Similar Questions

  • APEX 5 - update collection member number or date type fails

    Hi Experts,

    I use the pl/sql process onDemand (AJAX call). In this block, there is a procedure of apex_collection.update_member_attribute.

    If I call the procedure as below:

    In this example, I've used directly number 50 in NUMBER! to say the apex_collection to set the numeric field only.

    apex_collection.update_member_attribute
                                         (p_collection_name      => 'FUFI_MANAGER_BATCH_PARAMS',
                                          p_seq                  => APEX_APPLICATION.g_x01,
                                          p_attr_number          => to_number(APEX_APPLICATION.g_x02),
                                          p_attr_value           => 50
                                         );
    
    

    Here is 'Post' AJAX call settings (in my standard call): x 01-seq_id, x 02 - attr_number, x 03 - attr_value, x 04-value_type (n - number just for my info)

    He C001 ALWAYS updated instead of N001! attribute. In the documentation it is if I use the numeric value (I tried to_number too...) in p_attr_value, it updates attribute number.

    To_number example:

    updated in the character column.

    I'm doing something wrong?

    If I use a few collections with columns C001... C00N - update works. If I use the types of number and the date I can't update correct attribute members.

    Concerning

    J

    Jozef Demovic SVK wrote:

    I use the pl/sql process onDemand (AJAX call). In this block, there is a procedure of apex_collection.update_member_attribute.

    If I call the procedure as below:

    In this example, I've used directly number 50 in NUMBER! to say the apex_collection to set the numeric field only.

    1. apex_collection.update_member_attribute
    2. (p_collection_name-online 'FUFI_MANAGER_BATCH_PARAMS',
    3. p_seq => APEX_APPLICATION.g_x01,
    4. p_attr_number-online to_number (APEX_APPLICATION.g_x02),
    5. p_attr_value-online 50
    6. );

    I'm doing something wrong?

    If I use a few collections with columns C001... C00N - update works. If I use the types of number and the date I can't update correct attribute members.

    The apex_collection.update_member_attribute method is overloaded to handle different attributes and types of attributes. Note that PL/SQL documentation says Overload:

    PL/SQL allows you to overload the nested subprograms, subprograms in package and type methods. You can use the same name for several different subprograms if their formal parameters differ by name, number, order, or data type family... If formal parameters differ only in name, you must use named notation to specify the corresponding actual parameters.

    In this case you use notation named, but the parameter name p_attr_value means the call corresponds to the signature 1 method, which updates a character attribute.

    5 signature with the name of the parameter p_number_value is used to set a number attribute:

    apex_collection.update_member_attribute(
        p_collection_name => 'FUFI_MANAGER_BATCH_PARAMS'
      , p_seq            => APEX_APPLICATION.g_x01
      , p_attr_number    => APEX_APPLICATION.g_x02)
      , p_number_value    => 50);
    

    Also note that (a little bit counter-intuitive) p_seq is always a VARCHAR2 string.

  • Best way to prevent the collection of updated?

    I have a problem/question about the dataGrid control, see code attatched.

    When I click on a line in the lower grid I want to copy the information in the upper grid. I don't want the collection of grids below to be updated when I edit the cells in the upper grid.

    If I use the code attatched and edit a cell, the collection in the grid below to update when I scroll up and down lines (in the lower rack).

    The only way I can stop this update is to set the dataProvider "[{colA: dataGrid1.selectedItem.colA, colB: dataGrid1.selectedItem.colB, teachers: dataGrid1.selectedItem.colC}]" instead of "dataGrid1.selectedItem".

    Is this a bug or what I am doing wrong? It should be a better way to prevent the updated collection. I tried different events at the same time check if/when the collection is updated but no success here. I can't get the function 'preventDefault()' to work.

    Any solution/suggestion?

    Kind regards

    the Sweden newbe...

    You need two independent dataProviders, one for each grid. then you need to do a * copy * of the row of data before put you in the second dataProvider. This is because that just assign the object (selectedItem) will be just a reference to the same object.

    You could use ObjectUtils.copyObject (), or simply create a new Object() and assign the properties and the values for the new object, and then to the second dataProvider addItem().

  • How can we stop Member of "attribute" inheritance from parents to children?

    Dear all,

    Do you know how I can stop sharing the attribute member between parents and children?

    In the case, I need to change the currency of the parent (CAD $) entity, but I want children to keep the currency CAD.

    In my case, when I change the attribute of the entity, the children inherit the mother.

    For me, the legacy is applied automatically to all members of the sub of the parent.

    Thanks in advance for your support.

    Jean Daniel

    Hyperion Planning 11.1.2.3

    As described in the Administrator's Guide

    If a parent has several children, of whom only one child has a currency that is overridden, the mother inherits code currency overridden in Essbase (which is not displayed on the forms of data).

    I think that is what is happening with you... I guess nothing can be done to avoid this, as it is written in the bible of the oracle!

  • CN AD 11 g connector update attribute

    Hello

    We have OIM 11 g r1 talk to AD 2010 using AD 11.1.1.6 Connector. We are not able to update the CN attribute of the user on the last change of name or surname.

    Its our requirement to update CN of the user on the evolution of the FN or LN. Has anyone ever put in place this?

    Thanks in advance.

    You don't in fact to an update of the NC, you update the fully qualified domain name that is CN = XXXX, unit ORGANIZATION = ContainerXXXX, dc = XXX, dc = XXX, so it is actually going to use the entry for __NAME__.

    -Kevin

  • Having troubling my Master Collection CS5 update

    I'm having troubling update of my Master Collection CS5 it is said that "there is a download error" "altogether and try again. I have an Internet connect and download it, then it keeps giving me the SAME message, over and over again I try to update it.  Help-> updates...

    Any ideas?

    Thank you

    Eric

    For CS5:

    You must update the MAO Adobe - Adobe Application Manager: for Macintosh: Adobe Application Manager

    Help > updates should work after the update is installed.

    If you cannot run the installation program, it's probably because he is unsigned and Gatekeeper it blocks. Go to System Preferences > Security and privacy > General and value "allow applications downloaded on the" "Anywhere". Set it back during installation and updates are completed.

    Gene

  • ADF:how update attribute of link seen in master-detail relationship.

    Hi all

    I use jdev 11.1.1.5.0 version.

    I created a form master / detail using view link. My requirement is the Key attribute update sacrificed on Master table and same attribute on table automatically put details far because it fits on the link attribute.

    but his past when I change attribute link view main table, detail line stop display table.



    Thanks in advance

    Manish

    Your link on the association and for this assoc basic display, check the key attributes of the Cascade Update:

    https://blogs.Oracle.com/raghuyadav/entry/adf_entities_association_-_Cas

  • When any new Master CS5 Collection, "some updates could not be installed.

    My Win7 Pro x 64 system crashed the other day.  After the reconstruction of the system and the resettlement of Master Collection CS5, Photoshop ran and said he had a few updates available (for all applications, apparently not only Photoshop).  After trying to download, I got the error message "some updates could not be installed" and it listed most of the apps (like Photoshop).  The explanation for each of them was, 'there was a download error.  Quit and try again later. "Well, I have, several times, without success.  Any suggestions on how to get these?  Thank you.

    Hi Am_I_Lame,

    Greetings.

    • Use this direct link to update PS CS 5

    Concerning

    Rohit

  • Design Premium CS5 to a Master Collection CS6 update form

    Hey.

    A does anyone know if its possible to update forms a Design Premium CS5 to a Master Collection CS6?
    And how can I do this? Did not help on the adobe page or contact form

    Or any place where I can buy an update to a Version of CS6.

    Best regards
    Messa

    Found the Creative Suite 6

  • Bulck collection data update just hangs.

    Each no problem with anonymous block below? Can someone direct me to optimize this code. Scenario of having to update about 40 million lines to static value, I agree 1 million lines in a single loop. 1 million first lines are getting updated very soon probably in 2 minute, after that the hungs just code and I do not increase in the committed rows.


    Declare

    cursor c1 is
    Select the rowid of the t1
    where c1 is not null;

    TYPE t_rowid IS the TABLE OF the INDEX of ROWID OF directory;

    v_rowid t_rowid;

    Start
    OPEN c1;
    LOOP
    FETCH c1 COLLECT LOOSE v_rowid LIMIT 1000000;
    WHEN OUTPUT v_rowid.count = 0;
    FORALL i in 1.v_rowid.count

    setting a day of t1 set c1 = 'seda54t557790890778689890' where rowid = v_rowid (i);

    commit;
    end loop;
    commit;
    Close c1;
    end;

    Never engage inside the loop

    Do it in SQL

    update t1 set c1 = 'seda54t557790890778689890' where ROWID IN (select rowid from t1 where c1 is not NULL);
    
    commit;
    

    If you want to use SQL PL then

    BEGIN
    FOR i IN
    (
    select rowid from t1
    where c1 is not NULL
    )
    LOOP
    update t1 set c1 = 'seda54t557790890778689890' where rowid=i.rowid;
    END LOOP;
    COMMIT;
    END;
    
  • Collection not updated to the tier 2 on

    Created a collection but only the first line of 15 is saved. The user must be able to enter data initially and then return to the form and add stuff if necessary. What I forget?
    Thanks in advance!

    Here is the code

    Get the Dataset
    apex_collection.create_or_truncate_collection
      (p_collection_name => 'NEXT_ACTIONS_COLL');
    
    DECLARE
      v_id NUMBER;         --ECR_FORM_ID
      var1 VARCHAR2(30);   --ECRNO
      var2 VARCHAR2(60);   --NA_DEPARTMENT
      var3 VARCHAR(4000);  --NEXT_ACTIONS
      var4 VARCHAR(15);    --NA_CMPLT_DT 
      rw_ct  INTEGER;      --# of existing records - used for the cursor loop below
     
    
    cursor c_prepop is 
     
     select ecr_form_id, ecrno, na_department, next_actions, na_cmplt_dt
    from DOC_ECR_FORM
         where ECR_FORM_ID = :P14_ECR_FORM_ID
    ORDER BY 1;
    
      i         NUMBER;
      cntr      NUMBER := 10;
     
    BEGIN
    
      select COUNT(*) into rw_ct from DOC_ECR_FORM
         where ECR_FORM_ID = :P14_ECR_FORM_ID
          ORDER BY 1;
    
      cntr := cntr - rw_ct; --sets the number of times for loop will run
    
      OPEN c_prepop;
        LOOP
          FETCH c_prepop into v_id, var1, var2, var3, var4; 
           EXIT WHEN c_prepop%NOTFOUND;
    
           APEX_COLLECTION.ADD_MEMBER(
            p_collection_name => 'NEXT_ACTIONS_COLL',
            p_c001 => v_id,  --Primary Key
            p_c002 => var1,  --Text placeholder
            p_c003 => var2,  --Text placeholder
            p_c004 => var3,  --Text Area placeholder
            p_c005 => var4   --Text/Date placeholder
            );
        END LOOP;
      CLOSE c_prepop;
    
      for i in 1..cntr loop
        APEX_COLLECTION.ADD_MEMBER(
            p_collection_name => 'NEXT_ACTIONS_COLL',
            p_c001 => 0,
            p_c002 => NULL,
            p_c003 => NULL,
            p_c004 => NULL,
            p_c005 => NULL 
            );
      end loop;
    END;
    Build the form
    SELECT
    
    APEX_ITEM.TEXT(1, c001, 10, 10) id, --*ONLY FOR TESTING PURPOSES NOT USED THROUGH COLLECTION*
    
    APEX_ITEM.SELECT_LIST_FROM_LOV(3, c003,'DEPARTMENTS',NULL,'NO') NA_DEPARTMENT,
    APEX_ITEM.TEXT(4,c004, 100, 100) NEXT_ACTIONS,
    APEX_ITEM.DATE_POPUP(5,NULL,c005,'DD-MON-YYYY',10,10) CMPLT_DT
     FROM APEX_COLLECTIONS
      WHERE COLLECTION_NAME = 'NEXT_ACTIONS_COLL'
    order by c003
    Capture the data
    declare
    j pls_integer :=0;
    begin
    for j1 in(
     select seq_id from apex_collections
     where collection_name = 'NEXT_ACTIONS_COLL'
     order by seq_id)loop
     j:=j+1;
    
    
     apex_collection.update_member_attribute(p_collection_name=>'NEXT_ACTIONS_COLL', p_seq=>j1.seq_id,p_attr_number=>3,p_attr_value=>wwv_flow.g_f03(j));
    
     apex_collection.update_member_attribute(p_collection_name=>'NEXT_ACTIONS_COLL', p_seq=>j1.seq_id,p_attr_number=>4,p_attr_value=>wwv_flow.g_f04(j));
    
     apex_collection.update_member_attribute(p_collection_name=>'NEXT_ACTIONS_COLL', p_seq=>j1.seq_id,p_attr_number=>5,p_attr_value=>wwv_flow.g_f05(j));
    
    end loop;
    end;
    Write in the DB
    declare
    begin
      for y in (select TO_NUMBER(c001) x_key, (c002) x_1, (c003) x_2, (c004) x_3, TO_DATE(c005, 'DD-MON-YYYY') x_dt
       FROM APEX_COLLECTIONS
               WHERE COLLECTION_NAME = 'NEXT_ACTIONS_COLL'
        ORDER BY x_key
    )
    
    loop  
    if  y.x_key = 0
      THEN
           insert into DOC_ECR_FORM(ecr_form_id, ecrno, na_department, next_actions, na_cmplt_dt)
              values(DOC_ECR_FORM_SEQ.nextval, y.x_1, y.x_2, y.x_3, y.x_dt);
        
    elsif y.x_key > 0  then
    update DOC_ECR_FORM
    set 
    na_department = y.x_2,
    next_actions = y.x_3,
    na_cmplt_dt = y.x_dt
     
     where ecr_form_id = y.x_key;
     
       else
          DBMS_OUTPUT.PUT_LINE ('There’s an error.');
     
        end if;
      end loop;
    end;
    Published by: userRRRYB on August 18, 2010 13:39

    Hello

    If you add to the hidden form field containing the seq_id collection.
    When collection data is stored, a loop in this form element

    BR, Jari

  • Using Merge and collection of update/insert a table

    See any problem with this, or does anyone have a better solution? I am trying to insert or update a table using the values in the collection:
    BEGIN
    
    
    
    MERGE INTO TBL d
    
    USING (select c001, c002, c003, c004,c005 from htmldb_collections where collection_name='P77_COLLECTION') s
    
    ON (d.login_id = s.c001)
    
    WHEN MATCHED THEN
    
    UPDATE 
    
    SET d.case = s.c002
    
    WHERE d.collection_type = 'Exchange'
    
    WHEN NOT MATCHED THEN
    
    INSERT TBL (d.login_id, d.case, d.work_order, d.status, d.wo_close_date, d.collection_type)
    
    VALUES (s.c001, s.c002, s.c003, s.c004, s.c005,'Exchange');
    
    
    
    END;
    I get the following fake error message:

    ORA-06550: line 12, column 8: PL/SQL: ORA-00926: lack of keyword VALUES ORA-06550: line 4, column 1: PL/SQL: statement ignored

    Thank you
    -Abe

    You don't have to INTO or the name of the table, just WHEN NOT MATCHED THEN INSERT (col1, col2,...) VALUES (val1, val2,...)

  • Student member update

    Hi I need to continue my student membership that I will begin United in September, when my current subscription ends. I guess I need to update with my new student E-mail but don't know how.

    Manage your membership and your payment. Creative cloud

    https://helpx.Adobe.com/x-productkb/policy-pricing/membership-subscription-troubleshooting-creative-cloud.html

    Contact support - for the link below, click on the still need help? option in the blue box below and choose the option to chat or by phone...

    Make sure that you are logged on the Adobe site, having cookies enabled, clearing your cookie cache.  If it fails to connect, try to use another browser.

    Creative cloud support (all creative cloud customer service problems)

    http://helpx.Adobe.com/x-productkb/global/service-CCM.html ( http://adobe.ly/19llvMN )

  • 'Open default collection' not updated

    I'm having a problem in the settings collection since switching to the AEM properties. Eventually a development application - IAM I just finished creating the presentation, but I can't get the 'open default Collection' to serve browse Page (see the maps configurations etc.). It is always stuck on the display of the content (giving the individual article) no matter what I do. Other changes to collection that I put very well up-to-date.

    It's only a problem since the switch to MEA.

    I have a presentation unique, applied to a single collection, so Im pretty confident that everything is configured correctly.

    Any ideas?

    My guess is that you have run into the situation where a set of collection to the content view opens on the first article , unless the collection is launched in the app menu or higher level. In this case, it opens to the page go.

  • I have error 213:10 in Adobe Master Collection CS5 update to a new user on my system.

    I use adobe master collection CS5 on windows XP Professional, and I add a new user on my system.

    Now it's show error 213:10 (this is a problem with the license of the product). I tried so many times, but is not to solve.

    How to solve this error?

    You need to reinstall the software from scratch.

    Mylenium

Maybe you are looking for