How to use a Select list on a second primary key column in a tabular presentation?

Hello

I created a tabular presentation located on the details page of the user (form), that allows to manage roles for this user.

The shape of table contains 3 elements:
-> a checkbox
-> user (PK) column is hidden, and its default value is generated by a function pl/sql (to submit the time), which refers to the element to username.
-> the role of the column is displayed as a named select list LOV: add you a line, choose a role, submit, etc..

But my ROLES table (not created by me...) contains 2 columns: USER and GRANTED_ROLE.
The USER is the primary key, but a user can have multiple roles (= one line per role).
GRANTED_ROLE is the second primary key, so that we can differentiate between one line of another.

At the moment my tabular form has only one primary key (USER), so the GRANTED_ROLE can display as a list select.
But, for this reason, in my opinion, remove the button do not work: all the lines of the user have the same key, so when I select a few lines to remove these, all lines in the form of tables are deleted.

I don't know how my button Delete could recognize the subkey to remove only selected rows...
Or maybe I should use a different type of region?

Thanks for your help!
Fanny

In the process of ApplyMRD, try to specify the 'secondary key' column in the section "Source: Multi line Update and Delete"to the second column key in tabular form.»

I have not tested this with your situation, but worth it.

Tags: Database

Similar Questions

  • Select multiple items using a selection list?

    Hi all

    In my application, I have a HTML area with two elements of the selection list. According to the first value of the selection list, the second selection list will fill up.

    Now I want to show a report based on the second select value list, but I want to select several values in the second selection list. For this, I just activated the multiple selection option in the selection list item.

    But when I tried to implement this, the error occurs.

    Select multiple items using a selection list? If this is the case, how can I assign these values in the selection list element onchange attribute.

    Thank you
    David...

    A further possible solution to that above with the function of pipeline is to simply use Instr.

    Note: This option should be used if the amount of data is small or already filtered by other predicates.

    SELECT display_value, return_value
      from xxx
     where INSTR(':'||:P1_MASTER_MULTI_SELECTLIST||':', ':'||parent_value||':') > 0
     order by display_value
    

    BTW, if you use the new attribute "Cascading LOV Parent éléments" in the LOV section and set it to your parent element (in my example P1_MASTER_MULTI_SELECTLIST), the agenda of the child page is automatically updated if the master multi selection list is changed.

    Concerning
    Patrick

  • How to use the selection tool to resize a text box? Before I was able to click on the text box with the selection too in order to resize, but now I click on it and it only gives me 'path' or 'anchor' options.

    How to use the selection tool to resize a text box? Before I was able to click on the text box with the selection too in order to resize, but now I click on it and it only gives me 'path' or 'anchor' options.

    Ashley,

    What about window > show the rectangle enclosing (Ctrl / Cmd + Shift + B to toggle)?

  • How to find the primary key columns in the tables in MS Access using SQL queries

    How to find the primary key columns in the tables in MS Access using SQL queries

    Hello

    This is the forum for Windows Vista programs related issues.

    For better assistance, please try instead the Forums in SQL Server .

    Thank you! Vincenzo Di Russo - Microsoft MVP Windows Internet Explorer, Windows Desktop Experience & security - since 2003. ~ ~ ~ My MVP profile: https://mvp.support.microsoft.com/profile/Vincenzo

  • How to refer to the primary key column of newly inserted rows of tabular form

    Hello

    I use APEX 4.2.0.00.27 with Oracle DB 11.2.0.3.0.

    I work with a tabular presentation wizard-created for insert and update a table using the integrated SRM process (sequence 10).  I'm trying to use a process of anonymous block of PL/SQL (sequence 30) to make another manipulation of table after the records were inserted or updated.  The manual process is associated with my tabular form and I use the variables of name of column binding in my program block.

    My (rsn_test) table has 3 columns: test_id (number), test_nbr (number), test_id2 (number).  Test_id column is identified as the primary key and the type of the source already exists a sequence rsn_test_seq.  Column test_id2 gets its default value 0 to a hidden page element.

    I would use my manual process for updating the value of the test_id2 column.  If it's 0 then I want to put the value of the column test_id.  If it is any other value, then it must remain at this value.  My logic works very well for an existing line, but I'm running into a problem with the newly added lines.  The new lines get inserted, but the test_id2 column remains the default value 0.  I can tell the debugger that the SRM process is triggered first and inserts the line, then my manual dealing with fires.  The problem seems to be that the connection variable: TEST_ID for the primary key column remains NULL after insertion.  I don't know how to get the value of the column test_id of my newly created line to use in my PL/SQL block to my update.

    Process of PL/SQL:

    DECLARE
    BEGIN
       :P7_SHOW := NULL;
       :P7_SHOW := NVL(:TEST_ID2,555) || ' and ' || NVL(:TEST_ID,787) || ' and ' || NVL(:TEST_NBR,9999);
       IF :TEST_ID2 = 0 AND :TEST_ID IS NOT NULL THEN
          UPDATE rsn_test
             SET test_id2 = :TEST_ID
           WHERE test_id = :TEST_ID;
       ELSE
          :TEST_ID2 := :TEST_ID2;
       END IF;
    END;
    
    

    Excerpt from the debugger:

    0.01625 0.00010 Processes - point: ON_SUBMIT_BEFORE_COMPUTATION
    0.01635 0.00008 Branch point: Before Computation
    0.01643 0.00003 Process point: AFTER_SUBMIT
    0.01646 0.00022 Tabs: Perform Branching for Tab Requests
    0.01668 0.00008 Branch point: Before Validation
    0.01676 0.00024 Validations:
    0.01700 0.00135 Perform basic and predefined validations:
    0.01835 0.00020 Perform custom validations:
    0.01855 0.00049 ...Validation "TEST_NBR must be numeric" - Type: ITEM_IS_NUMERIC
    0.01904 0.00007 ......Skip for row 1 because row hasn't changed
    0.01911 0.00016 ......Skip for row 2 because row hasn't changed
    0.01927 0.00012 ...Validation "TEST_ID2 must be numeric" - Type: ITEM_IS_NUMERIC
    0.01939 0.00007 ......Skip for row 1 because row hasn't changed
    0.01945 0.00018 ......Skip for row 2 because row hasn't changed
    0.01964 0.00005 Branch point: Before Processing
    0.01968 0.00004 Processes - point: AFTER_SUBMIT
    0.01972 0.00588 ...Process "ApplyMRU" - Type: MULTI_ROW_UPDATE
    0.02560 0.00154 ...Execute Statement: declare function x return varchar2 is begin begin for c1 in ( select "RSN_TEST_SEQ".nextval pk from sys.dual ) loop return c1.pk; end loop; end; return null; end; begin wwv_flow.g_value := x; end;
    0.02714 0.00140 ......Row 3: insert into "APPPCSRSN"."RSN_TEST" ( "TEST_ID", "TEST_NBR", "TEST_ID2") values ( :b1, :b2, :b3)
    0.02854 0.00011 ...Process "ApplyMRD" - Type: MULTI_ROW_DELETE
    0.02865 0.00004 ......Skip because condition or authorization evaluates to FALSE
    0.02869 0.00015 ...Process "Process Submit" - Type: PLSQL
    0.02884 0.00007 ......Skip for row 1 because row hasn't changed
    0.02891 0.00012 ......Skip for row 2 because row hasn't changed
    0.02903 0.00012 ......Process row 3
    0.02915 0.00429 ...Execute Statement: begin DECLARE BEGIN :P7_SHOW := NULL; :P7_SHOW := NVL(:TEST_ID2,555) || ' and ' || NVL(:TEST_ID,787) || ' and ' || NVL(:TEST_NBR,9999); IF :TEST_ID2 = 0 AND :TEST_ID IS NOT NULL THEN UPDATE rsn_test SET test_id2 = :TEST_NBR WHERE test_id = :TEST_ID; ELSE :TEST_ID2 := :TEST_ID2; END IF; END; end;
    0.03344 0.00013 ...Session State: Saved Item "P7_SHOW" New Value="0 and 787 and 1300"
    0.03356 0.00004 Branch point: After Processing
    0.03360 0.00048 ...Evaluating Branch: "AFTER_PROCESSING" Type: REDIRECT_URL Button: (No Button Pressed) Condition: (Unconditional)
    0.03407 0.00013 Redirecting to f?p=290:7:8717971109610:::::&success_msg=0%20row(s)%20updated%2C%201%20row(s)%20inserted.Success%2FEBD244168556408CBA714E3974918C09%2F
    0.03420 0.00012 Stop APEX Engine detected
    0.03432 0.00007 Stop APEX Engine detected
    0.03439 - Final commit
    
    

    Any suggestions?

    I have run tests on

    https://apex.Oracle.com/pls/apex/f?p=83488:1 demo/demo

    to see your problem.

    I have 2 solution for your problem.
    I add trial NOT tabular just usual block of PL/SQL

    BEGIN
    I'm IN (SELECT TEST_ID FROM RSN_TEST WHERE TEST_ID2 = 0)
    LOOP
          UPDATE RSN_TEST
             SET test_id2 = TEST_ID
           WHERE test_id = i.TEST_ID;
      END LOOP;
    END;

    and works very well, you can see in the sample.

    The other solution is to show new generated TEST_ID

    Adding a sequence as a default value for a column in a table field

    And to execute your procedure.

    I get how is with the good luck of time.

    By

  • How to convert a single column in the primary key column

    Hi all

    I have a column that's unique cnstraint, this column contains the value as digital and also null.

    So how do you convert to primary key column

    Concerning
    Prashant

    Prashant wrote:
    Hi all

    I have a column that's unique cnstraint, this column contains the value as digital and also null.

    So how do you convert to primary key column

    Concerning
    Prashant

    Prashant,

    You must assign new values to null values. You can use a sequence to produce the figures in this column.

    Select max (your_unique_column) from your_table; -find the maximum value of this column, so you can start the sequence of this number.

    create sequence seq_for_your_table with XXXX - value max + 1 you have found

    Update your_table set your_unique_column = seq_for_your_table.nextval () where your_unique_column is null

    You can create a primary key on this column.

    Best regards

    Grosbois

    -------------------------------------------------------
    If you answer this question, please mark appropriate as correct/useful messages and the thread as closed. Thank you

  • Diagram of all the tables list of primary key column names

    Hi people,

    I have a Scott user for example, I want to retrieve all tables primary key column names in the user Scott.

    can someone help me please.

    Thanks in advance,
    karmaya

    You can log in to SCOTT and try this

    select c.constraint_name
         , cc.table_name
         , cc.column_name
      from user_constraints c
      join user_cons_columns cc
        on c.constraint_name = cc.constraint_name
     where c.constraint_type = 'P';
    
  • How to call parameter (selection list) in the box

    Place of auto-refresh on the browser by clicking the check box,

    Attributes page, Javascript, function and declaration of global variables

    var gtReloadPage;

    "autorefresh" dynamic action

    2 real actions:

    Run the PLSQL code

    null;

    Page items to submit: P1_CHECK_BOX
    Fire on loading the page: CHECKED

    Execute javascript code

    Alert ('ok - timeout parameter');
    gtReloadPage = setTimeout ("location.reload (true);", 8000);

    Fire on loading the page: CHECKED

    2 false actions:

    Run the PLSQL code

    null;

    Page items to submit: P1_CHECK_BOX
    Fire on loading the page: UNCHECKED

    Execute javascript code

    clearTimeout() (gtReloadPage);
    Alert ("timeout has been deleted!");


    Fire on loading the page: UNCHECKED

    It works very well...

    However, the requirement was that the user must enter the time accroding to its page e.g. obligation to refresh after the selected time from the selection list.
    for this I created the name P1_time_select of the selection with the static value list ('1 min round trip = 60000', '5 min round trip = 300000 ") and I call the javascript in code of dynamic action that has been created, as
    gtReloadPage = setTimeout ("location.reload (true);",: P1_time_select);
    but it's not working. Guide please how do I call the selection list in the box to auto refresh

    created for example on apex.oracle.com
    http://Apex.Oracle.com/pls/Apex/f?p=124545:1:13858430141379:

    workspace: SIRAF
    username: [email protected]
    password: 9469471

    Published by: JohnMackanzi on 7 November 2012 22:29

    Hello

    If you want to access the list of selection within the javascript code value, use $x('ITEM_NAME').value

        gtReloadPage = setTimeout("location.reload(true);",$x('P1_SELECT_LIST').value);
    

    Hope this helps, Mimi

  • Using the selection list

    Hello:

    I have created a form where I would like to include a few select list boxes.

    When I run my form, I meet two types of questions in which I could use help in troubleshooting.

    Question No. 1:
    I have a field called SPECIALTY. This field in the database is a NUMBER.
    If my user does not select a specialty, the following error message occurs: ORA-01722: invalid number

    I checked the value that is passed to the field and the value is null %. I think that the reason for this error message is that the SPECIALTY is a numeric field and the % value % null is character.

    One, why this null value % of filling in my table? If the user does not select anything, regular null must appear in the column.
    Two, how to replace this % % null value?

    Question 2:
    I have a field called STATE. The field in this table is a VARCHAR2 (2).
    If my user does not select a status code, the following error message occurs:-12899: value too large for column 'TEST '. "ORGANIZATION '." "' SUFFIX ' (real: 6, maximum: 2).

    I checked the value that is passed to the field and the value is also null %. Well, null % is certainly 6 characters and does not fit into a column defined with a width of 2.

    What can I do to fix this problem? I do not understand why null % keeps being inserted in the DB when anyone makes a selection in the select list. Is it possible that we can replace this value and insert the value null ordinary? When I speak of 'regular null value', I mean when I have a text field and it is empty, a null value is inserted into the table, but it does not appear as null %. To place the value in the DB looks like (null).

    Can someone help me?
    Thank you.

    Hello

    Go to your list of selection-> list of values definition:

    The value 'Null return value' for example to zero.

    Based on what you expected store in your table, you can change your insert, update function for:
    for example, if you want to store the value null:
    Decode(:P22_SELECT_LIST,0,,:P22_SELECT_LIST);

    Best regards, Kostya Proskudin

  • Region of report filters by using Multi Select lists

    Could someone please advise me accordingly.

    I want to use several multi selection lists to allow a user filter data in a report. I have a button for the user to send the page and apply their selected criteria. In my application I have want to reference the items select direct multi.

    for example

    Select studentid, studentname
    of student_table
    where of course in(:p1_course)
    and the Department (: p1_dept)
    and in the year (: p1_year)
    and... etc etc.

    My attempts to do so to this day, have been in pallets. I was hoping that one of you experts may be able to advise how to do this step by step.

    Thank you

    Steve C

    Hi Steve,.

    The results of the selections multiple lists would be in the format has: b: c (that is to say, the values separated by semicolons), so your WHERE clause must use something like:

    OÙ ' :' || : P1_COURSE | ':' AS ' %:' | COURSE | ':%'

    or

    WHERE INSTR (': ' |: P1_COURSE |) ':', ':' || COURSE | ':') > 0

    Andy

  • How to filter a selection list

    I have several lists of selection.  All have FKs in the parent table.  The relationship of the tables is the following:

    BLDG - < ROOMS - < LOCATIONS - < POSITIONS

    ROOMS have a FK to buildings, PLACES a FK to ROOMS and POSITIONED a CF for LOCATIONS

    I have a form where the user will enter their selection for each attribute, and I want the ROOM list only see the room in the selected building, LOCATIONS in the ROOM chosen, etc.

    The selection list is defined as:

    Select room_number d, room_id r

    ROOMS

    where bldg._id =: P2_BLDG_ID

    P2 is the page where the user enters data.  All lists, follow the above format and the corresponding value of FK.

    When I test data entry any of the lists to return all data.  I guess that's because the corresponding value of the page has the value null when the page opens, and the list is not updated when the user makes the corresponding selection.  How can I get APEX to fill the lists once the user makes a selection of the corresponding value of parent?

    2785699 wrote:

    I have several lists of selection.  All have FKs in the parent table.  The relationship of the tables is the following:

    BLDG-<><><>

    ROOMS have a FK to buildings, PLACES a FK to ROOMS and POSITIONED a CF for LOCATIONS

    I have a form where the user will enter their selection for each attribute, and I want the ROOM list only see the room in the selected building, LOCATIONS in the ROOM chosen, etc.

    The selection list is defined as:

    Select room_number d, room_id r

    ROOMS

    where bldg._id =: P2_BLDG_ID

    P2 is the page where the user enters data.  All lists, follow the above format and the corresponding value of FK.

    When I test data entry any of the lists to return all data.  I guess that's because the corresponding value of the page has the value null when the page opens, and the list is not updated when the user makes the corresponding selection.  How can I get APEX to fill the lists once the user makes a selection of the corresponding value of parent?

    Cascading selection lists are covered in the documentation.

  • How to deletions has selected list item from a list item.

    How delete a list item selected in a list item.

    My question that I should write to list_index so that it indicates the selected list item

    DELETE_LIST_ELEMENT (Nom_liste, list_index);

    -----
    Form of Oracle 10g

    Hello

    The trigger when-list-changed fires whenever the value has been changed.
    You get this value/index with the following:

    DECLARE
       LC$Liste  Varchar2(61) := :system.cursor_item ;
       LC$Valeur Varchar2(30) := Name_In( LC$Liste ) ;
       LN$Nbre   Pls_integer ;
    BEGIN
    
       LN$Nbre := Get_List_Element_Count( LC$Liste ) ;
    
       For i IN 1 .. LN$Nbre Loop
          If Get_List_Element_Value( LC$Liste, i ) = LC$Valeur Then
             -- you get the selected value, and index there --
             :BLOC2.LABEL := Get_List_Element_Label( LC$Liste, i ) ;
             Exit ;
          End if ;
       End loop ;
    
    END;
    

    François

  • How to use the select statement in loop for

    Hi all

    My question is can I use a select statement in for loop like as follows.

    for the key in the selection of one_table key.

    When I use this am getting an error as found select invalid I ID

    How to select a statement use in loop for

    Please suggest me.

    Thank you
    Sree

    Hello

    You can use code below

    For key in (select button from table_a)
    loop
    If key.key = 1 then
    -insert statement
    on the other
    -Select statement
    end loop;

    Thank you
    Naveen.

  • Filter a shuttle using the selection list

    Hi all

    Apex 3.1.2 version

    I've seen a few posts on how to filter values in a shuttle and I tried a solution but I can't seem to do it all together.

    What I do is this...

    I have a shuttle service (P2_APPLY_TO_LINES) that contains a list of items, this list may be very long. Next to the shuttle users want to have a selection list (P2_MANUFACTURER_FILTER) where they can choose a manufacturer. Choose a manufacturer in particular will again fill the left side of the shuttle with only the items for the manufacturer.

    If someone got something like this works? If Yes can you please elaborate?

    For attributes of HTML selection list form elements, I have the following call, but I can't seem to get the right code

    OnChange = "f_filter_shuttle_item (this, 'P2_APPLY_TO_LINES').


    I also think I need to point to the application and the application process, but don't know what to do with the.

    Thanks for your help!

    Why you do not create a selection with mailing list and a shuttle service will be to repopulate itself to your selection list condition?

  • LOV SQL: How to configure a selection list to get all the records

    Hello

    I use Oracle 10 g with APEX 2.0.

    Here's my question:

    I have a report and I use 3 text fields and a selection list to search in a join of two tables. The selection list is composed of a "list of values" and the parameter is used in the SQL sentence, has a numerical value.

    Table of results after the join operation looks like this:
    Field1 Field2 Field3 Field4 (assuming that the field3 is used in the select list).
    21 has this NL 1000
    21 bis as 1001-vb
    33 so 1012 ct

    What I want to do is put another pair of the value of the parameter in the select list to let the user choose the "ALL" items mentioned in the selection list, so that the search returns all records without taking this select list-field into account.

    Is it possible to do it with SQL and LOV? Do I need other functions? or configurations?

    Thanks in advance,

    Sedef

    Hi user630478!

    I always use a selection with submit list and the option to get a NULL value for such things. To solve your problem do the following:

    1.) create two named LOVs. As you have already done and another for all values.
    2.) to submit your selection list must be configured to display a NULL value e.g. it shows EVERYTHING with the value 0.
    3.) create two conditional branches that work with your selection list. Which show normal results, if a user has clicked on a normal value and the second should act only if a user has clicked on the WHOLE.
    4.) write a process triggering the LOVs in your selection from one to the other list. This process should only be fired if the second conditional branch has been activated.

    As I understand it that's maybe what you want to know.

    Yours sincerely

Maybe you are looking for

  • Updated drivers again using Skype

    Hello I've used Skype without any problem, but had to have my laptop rebooted everything is now going well except Skype. I have installed and uninstalled twice, but it does not recognize my internal webcam. I thought I would try updating my driver, b

  • Problems of heating on motorcycle G4 more

    Festers even when they are kept for the load. And the battery is draining too fast :-/

  • Result missing reports

    Hello I'm having a problem with my results file.  If I run the sequence on the development of Pc teststand, it works fine, but when I deployed the code and run it on a PC deployment the HTML only summary shows only the first failure. for example 4.1

  • XP3 st6uck in safe mode will not start or run msconfig help

    someone knows how to order for it to stop and bring up msconfig to fix to normal, I can't restart to normal or last good config

  • Spectrum of HP x 360: buy a HP x 360 at German amazon spectrum

    Hello! I plan to buy a x 360 HP spectrum, but I don't know whether or not the model sold on Amazon.de * a German Amazon * international keyboard layout or a German keyboard, because I need a keyboard international available qwerty. I hope someone has