Make multiple selections by comma delimited

I'm pretty new to APEX and I'm trying to create a multiple-selection list box. I am able to create the list box, and when I look at the session variable values are separated by a colon. Is it possible that I can have these separated by a comma if I can do something like this


SELECT THE EMP
From emptable
where empid in (: emp)

Thanks for your help.

I don't know if this will help, but if you have Oracle 11 g R2, you get this:

SELECT  LISTAGG(empid, ',') WITHIN GROUP (ORDER BY empid) AS employee_id
FROM   employees;

Result:

1000,1001,1002,1003

Published by: Vitor Rodrigues on 17 Feb 2012. 17:15

Tags: Database

Similar Questions

  • How can I make multiple selections in a tree by using < shift > click

    I feel like I'm something obvious missing here, but I searched a bit around without solution.

    I have a tree with checkboxes (ATTR_SHOW_MARKS is enabled). I am able to select multiple items in the list (ATTR_SELECTION_MODE is VAL_SELECTION_MULTIPLE). click work to select several, but my question is, when you use click it only marks (as in the boxes of checks) on the first and last items. The others are selected but not verified.

    Is there an option I'm missing here, or I don't have to write code to manually mark? If I need to write the code, is the best way to check the State KEYPRESS if EVENT_SELECTION_CHANGE?

    Thanks in advance,

    Chris

    You can try to define ATTR_DRAGGABLE_MARKS and see if it suits your needs.

    If you really want to set the status of the brand by using , then Yes, you will need to write the code to do. You can use GetGlobalMouseState to get if the SHIFT key is down.

  • How can I make multiple selections in a list box fill a different text box?

    I have about 100 items in a list box.  However I should never select up to 10 items at a time.  So, since it would fill pages that the entire issue of items to see which are selected at a glance, I'd like o keep the small list box, and I select the elements they have appear in a different text box...

    I have Acrobat Standard XI, is this possible and if so, how?

    Thank you

    You can use this code as the custom text field calculation script, but it will update as soon as you leave the list box:

    var v = this.getField("List Box1").value;
    if (typeof v=="string") event.value = v;
    else event.value = v.join(", ");
    
  • 'Control' key for multiple selections

    I use 2 merger and can not get the Mac keyboard keys 'Control' (right or left) to behave like windows 'Ctrl' key to make multiple selections. A touch of 'control' behaves like a right-click and does not mark a selection. I also tried the Mac "command" key, but this fact is to open the start menu. I've searched the forums and all I can find are posts which is advised to disable the checkbox 'Activate mouse Mac OS shortcuts' in the preferences of the merger. This box was already unchecked so I need another option. Can someone point me in the right direction?

    I have no problem with a Windows normal ctrl-click to select several objects when my from VMware Fusion preferences are defined as in the image below.  Note: IIRC it is a bug if you have changed the default key mappings with the CTRL key, and if yes, then you must restore the default value under key mappings.

    Post edited by: WoodyZ

  • Multiple selection query to view the selected line

    Hi all

    I have a requirements make multiple selection of a region in the table and need to display the values of the selected line in the page.

    so I'm able to multiple selection of the table, but all when trying to print the values, it is still only printing selected values of line one not several.

    the code I use to print several rows below the selected values.

    for (int i = 0; i < fetchedRowCount; i ++) {}
    Rowi ABCEOViewRowImpl =
    (ABEOViewRowImpl) selectIter.getRowAtRangeIndex (i);

    If (rowi! = null) {}
    If (Y".equals (rowi.getReprint ())) {" "}
    for (int j = 0; j < fetchedRowCount; j ++) {}
    String srnum = rowi.getSerialNumber ();

    throw new OAException ("after Srno" +)
    srnum,
    OAException.INFORMATION);
    }
    }
    }
    }

    where fetchedrowcount - no lines in the region of the table
    Here srnum is printing only one value.

    Please guide me where to check this problem.

    Thank you
    Deb

    Hi Deb,

    Unable to get the requirement. Why the second for loop... ?

    Still, the OAException must be thrown exception during the first use that meets the condition.

    Please try to use "srnum" in tabular or use it to add all the required values in the for loop and finally throw the exception.

    Concerning
    Sanujeet

  • The MySQL Multiple selection list

    How to make multiple selections in the drop-down list in a form in Dreamweaver 8 and publish on MySQL?

    I tried using implode as recommended here: http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=12 & catid = 263 & threadid = 1112556 & highlight_key = y & keyword1 = multiple

    It worked unless the user did not select all the items in the list. Then, I got a bad argument error message.

    Then I tried just using POST without the implode and [] at the end of the name, but this put the word 'Picture' in the row/column in the database instead of the data.

    I then tried the POST with [the] on the chosen name and [] in the SQL statement: GetSQLValueString ($_POST [' devices [] ""], "text"), Dreamweaver wouldn't let me associate it under Insert a record in the section of the server behaviors - so nothing is put in the database.

    I need to be able to display multiple selected items in a list box for MySQL, but allow the user to select nothing in the drop-down list without receiving an error.

    Thank you very much for your help. In the end, he has worked with put the [] after the name and the following code:

    GetSQLValueString (isset($_POST['appliances'])? implode ("-", $_POST ['appliances']): "", "text")

  • How to make default an element selected in the multiple selection list

    Hello

    I'm filling the list of multiple selection of a lov (dynamic lov). Is it possible to do by default one of the selected items in the list.

    Please let me know how to do this...

    Thanks /.

    How do you determine that a particular value of the LOV must be the default?
    You should be able to combine the LOV query and your 'default selection' health by using an SQL statement or a pl/sql function and specify it for the 'default value Type' in the section 'Default' definition of the elements page.

    CITY

  • regular expressions for numbers demical in a comma-delimited list


    I have a table that lists the details of the occupation of the sites of a comma-delimited list:

    create table tenure_test)
    number of site_number
    tenure_detail varchar2 (255));

    insert into tenure_test values (1, ' Crown (Other) (0.15 ha), private (555.25 ha)');
    insert into tenure_test values (2, ' private (5.76 ha)');
    insert into tenure_test values (3, ' private (0.18 ha, Crown (3.25 hectares), Indeterminate (Leased) (5.85 ha)');)

    What I want to do is to use a regular expression to calculate the sum only numbers in the tenure_detail column.

    For example, for site_number 1, it would be 0.15 + 555.25 = 555,4

    I also have another regular expression that has just the numbers in a comma-delimited list.

    For site_number 1: 0.15, 555.25

    I tried this:

    Select site_number, tenure_detail, regexp_substr (tenure_detail, "[0-9] + \.") ([0-9] {2}') under the name test1

    of tenure_test;

    but it lists only the first number.

    Hello

    996454 wrote:

    I have a table that lists the details of the occupation of the sites of a comma-delimited list:

    create table tenure_test)
    number of site_number
    tenure_detail varchar2 (255));

    insert into tenure_test values (1, ' Crown (Other) (0.15 ha), private (555.25 ha)');
    insert into tenure_test values (2, ' private (5.76 ha)');
    insert into tenure_test values (3, ' private (0.18 ha, Crown (3.25 hectares), Indeterminate (Leased) (5.85 ha)');)

    What I want to do is to use a regular expression to calculate the sum only numbers in the tenure_detail column.

    For example, for site_number 1, it would be 0.15 + 555.25 = 555,4

    I also have another regular expression that has just the numbers in a comma-delimited list.

    For site_number 1: 0.15, 555.25

    I tried this:

    Select site_number, tenure_detail, regexp_substr (tenure_detail, "[0-9] + \.") ([0-9] {2}') under the name test1

    of tenure_test;

    but it lists only the first number.

    Here's one way:

    SELECT site_number

    SUM (TO_NUMBER (REGEXP_SUBSTR (tenure_detail

    , "\d+\.\d*" - see Note 1

    ) T

    LEVEL

    )

    )

    ), Total

    OF tenure_test

    CONNECT BY LEVEL<= regexp_count="" (="">

    , '\d+\.\d*'

    )

    AND PRIOR site_number = site_number

    AND PRIOR SYS_GUID () IS NOT NULL

    GROUP BY site_number

    ;

    Output:

    TOTAL OF SITE_NUMBER

    ----------- ----------

    1 555,4

    2 5.76

    3 9.28

    Note 1: what exactly makes a 'number '?  I'm assuming it's 1 or more digits, followed by a comma, followed by 0 or more numbers.  You can have a slightly different definition; in this case, change the arguments 2nd REGEXP_SUBSTR and REGEXP_COUNT.

    I guess also that site_number is unique.  If not, you will have to change the CONNECT BY and GROUP BY clauses, to refer to something (or a combination of things) which is unique.

    Relational databases are designed for each column of each row contain 1 single piece of information, not a list delimited with a variable number of elements.  It is so basic to the design of database he called the first normal form.  If your first followed table form normal, this query (and many other queries that involve that table) would be much simpler to write, more efficient to run and less likely to have bugs.  See if you can normalize this table.  Any effort that you have to spend now to normalize the table will pay very quickly.

    Thanks for posting the CREATE TABLE and INSERT statements; It is very useful.

    Don't forget to tell what version of Oracle you are using.  I tried the query in Oracle 11.2 above.  You may need to CONNECT BY a little differently in earlier versions, and REGEXP_COUNT will not work in Oracle 10.

  • Multiple selection with binding variable error

    Hello world

    I tried to put in place an array of adf multiple selection with another table, by following the tutorial (http://www.oracle.com/technetwork/developer-tools/adf/learnmore/75-multi-parent-row-detail-views-328078.pdf), page 3.

    I created all things and first of all I had an exception error, which I fixed, but now, whenever I try to select multiple lines, it won't update the table of the adf.

    In this example, I choose a service line and it shows the emplooyes, but every time I try to choose another line by ctrl clicking on it, the employees table be updated.

    Since I tryied to follow the tutorial, I'll put the code for the bean, I created for this purpose (it's a little different than the code given by the tutorial, but only because I had to get rid of the exception error)

    I use jdeveloper Studio Edition Version 12.1.2.0.0.

    Here is my code for the bean.java:

    Select listen port defined for the departments table. The selected line keys are read in the reference table.

    For each line, the Department ID value is read and added to a string buffer that generates a comma-delimited

    List of the departmentIds. In the end, this string is passed as an argument to the link of action ExecuteWithParams

    {} public void onDepartmentTableSelect (SelectionEvent selectionEvent)

    variable to hold the string containing the selected set value line departmentId

    StringBuffer departmentIds = new StringBuffer();

    Go to the main table to read selected line keys

    RicheTableau rt = selectionEvent.getSource ((richeTableau));

    RKS RowKeySet = rt.getSelectedRowKeys ();

    Iterator selectedRowsIterator = rks.iterator ();

    memorize the current line to place it back in the end key

    CurrentRowKey () rt.getRowKey = (list);

    for each selected master line, determine the departmentId

    int size = 0;

    {while (selectedRowsIterator.hasNext ())}

    size ++;

    The rowKey () selectedRowsIterator.next = (list);

    each value is terminated by a comma

    If (departmentIds.length () > 0) {}

    departmentIds.append(",");

    }

    take the current line

    rt.setRowKey (rowKey);

    JUCtrlHierNodeBinding wrappedRow = rt.getRowData ((JUCtrlHierNodeBinding));

    Line rw = wrappedRow.getRow ();

    /*

    Number departmentId = (number) rw.getAttribute ("DepartmentId");

    */

    int departmentIdInt = rw.getAttribute ("DepartmentId") (Integer);

    oracle.jbo.domain.Number departmentId = new oracle.jbo.domain.Number (departmentIdInt);

    departmentIds.append (departmentId.stringValue ());

    }

    back the foreign currency on the line

    rt.setRowKey (currentRowKey);

    Run the query on the detail table

    BindingContext bctx = BindingContext.getCurrent ();

    BindingContainer links = bctx.getCurrentBindingsEntry ();

    OperationBinding executeWithParams = bindings.getOperationBinding("ExecuteWithParams");

    executeWithParams.getParamsMap () .put ("departmentIds", departmentIds.toString ());

    executeWithParams.execute ();

    refresh the detail table

    AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance ();

    adfFacesContext.addPartialTarget (employeeTable);

    }

    }

    If someone has an idea of why it isn't updated table, please answer. Any idea can help.

    Thanks in advance.

    Greetings,

    Frederico Barracha.

    Finally, I found the problem...

    The problem was that I had to remove a line in the properties of my table, the property services: selectedrowkeys, because he only spent the last selected row.

    Yet, I apreciate the help and I had to replace a code in the bean.java, in reason of the exception error and you had to do. Maybe I did a configuration in the wrong way and he would not.

    Thanks for the help.

    Kind regards

    Frederico.

  • Delete in the database based on the values of the multiple selection list

    Hello

    I have a selectlist in Apex and a function in the database to make a deletion based on the value selected in the selection list.
    FUNCTION delete_batch (v_batch VARCHAR2) RETURN VARCHAR2
    IS
    BEGIN
    IF v_batch like 'M%'
    THEN
       RETURN ('A monthrun cannot be deleted');
    ELSE
       DELETE FROM so_disco_pa
       WHERE  batch = v_batch
       ;
       DELETE FROM so_batch_pa
       WHERE  batch = v_batch
       ;
       COMMIT;
       RETURN ('Batch '||v_batch||' has been deleted');
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
        RETURN ('Batch could not be deleted');
    END delete_batch;
    The package is called when the user clicks on the button Delete with the rest of the process:
    BEGIN
    DECLARE
    x   varchar2(100);
    BEGIN
    x := pa_control.delete_batch (:P3_BATCH);
    :F105_MESSAGE := x;
    END;
    END;
    Now, I want to change the selectlist for a multiple-selection list to make several batches can be deleted.

    How can I change my procedure and the procedure to remove lots based on the values selected?

    Thank you

    Diana

    dianap says:
    I got this far, but only the first batch selected in the list is being deleted. The other values of selected package are not removed.

    Help please.

    Move the RETURN statement out of your loop.

  • Multiple selections cascading lists

    Hi all

    I have two lists of multiple selections called: P1_PARENT and: P1_CHILD. When a user selects a value of: P1_PARENT values of: P1_CHILD are filtered accordingly. This works well and is very easy through ApEx 4.0.

    I express this so that a user can select several elements of: P1_PARENT and filter: of P1_CHILD the value accordingly. The problem I have is that ApEx return the: P1_PARENT value as a string delimited by two points and I find it difficult to identify means to refer to this in the SQL code to: P1_CHILD, or how to create: P1_CHILD of a PL/SQL function.

    I want to use for SQL: P1_CHILD LOV would be something like:

    SELECT display, return
    TABLE
    WHERE parent_id in (: P1_PARENT);

    This property will return an error such as: P1_PARENT is not a number.

    Help, please!
    Thank you
    Lucy

    Lucy,
    you need a function in pipeline to be able to select from your list of parents separated by commas. This same function can be used for your START WITH id in the clause, but be careful with several relatives in hierarchical queries.

    create or replace type my_varchar_table_type as
    table of varchar2(255) --or however large you need your strings to be
    /
    
    create or replace
    function get_my_values ( p_string in varchar2 ) return my_varchar_table_type pipelined is
    t_vars apex_application_global.vc_arr2;
    begin
       t_vars := apex_util.string_to_table( p_string );
    
       for j in 1 ..  t_vars.count
       loop
         pipe row ( t_vars(j));
       end loop;
    
       return;
    
    end;
    /
    

    Then you should be able to do things like (just a model... you'll probably need to fix it a bit)

    SELECT display_val d, return_val r
    FROM (SELECT column_1, column_2, CONNECT_BY_ISLEAF IsLeaf
    FROM my_table
    START WITH id in
     (select to_number column_value)
      from table(get_my_numbers (:P1_PARENT))
      )
    CONNECT BY PRIOR id = parent_id)
    where IsLeaf=1
    

    I would really have a utility package and put this function in

    See you soon
    Kofi

  • Is it possible to convert an array of values in a comma-delimited-list?

    Hello
    I want to transform the following dataset:

    Parent | Child
    ----------------------
    Charles | William
    Charles | Harry
    Anne | Peter
    Anne | Zara
    Andrew | Beatrice
    Andrew | Eugénie

    in this:

    Parent | Children
    -----------------------------
    Charles | Diana, Camilla
    Anne | Peter, Zara
    Andrew | Beatrice, Eugenie

    In other words, I would like to make a list of values from some of the major and produce them as a comma-delimited list.

    I know that his is possible in T - SQL, even if the method is a bit of a nasty hack. Is this possible in PL - SQL?

    Thaks in advance
    Jamie
    SQL>  with t  as(
     select 'Charles' parent, 'William' child from dual union
     select 'Charles', 'Harry' from dual union
     select 'Anne', 'Peter' from dual union
     select 'Anne', 'Zara' from dual union
     select 'Andrew', 'Beatrice' from dual union
     select 'Andrew', 'Eugenie' from dual
    )
    --
    --
    select parent, rtrim(xmlagg(xmlelement(e,child || ',')).extract('//text()'),',') childs from t
    group by parent
    /
    PARENT     CHILDS
    ---------- --------------------
    Andrew     Beatrice,Eugenie
    Anne       Peter,Zara
    Charles    Harry,William       
    
    3 rows selected.
    

    Don't know how Diana & Camilla suddenly jumped in many... ;)

  • Settlement data based on multiple selection ListBox reference need help

    Hello again,

    The question that I have is selecting from a listbox with multiple selection to fill the tables with the selected data. My code is as follows:

    Void loadData_EventClick (ByRef This)

    Dim j

    Dim k

    k = 0

    If ListBox.MultiSelection.Count = 0 Then Exit Sub

    For j = 1 To ListBox.Items.Count

    If ListBox.MultiSelection (j). Count = True Then

    k = k + 1

    End If

    Next

    TextBox.Text = k

    End Sub

    The code works perfectly up to the second if statement. My current channel group list contains 16 channels and with the second if statement guided the textbox output is equal to 16 (i.e. k = 16), which is what I expected. Im just using the k = k + 1 for the test. Eventually will be replaced by operating code specific to what I need to do.

    So the question that I have is to get the code to recognize what values are selected and referring to the index for the selections in a table. Im not sure on how to do it.

    Any help is very appreciated.

    Thank you

    ~ Nathan

    Attached JPEG shows the current user interface and the output of k with the second if statement commented

    Hey Nathan--

    ListBox.MultiSelection () is a function that returns an array of [multiple] selected items in ListBox.

    ListBox.MultiSelection.Count is a property that returns the number of items in the table above.

    Therefore, the logic in your second IF statement that says if ListBox.MultiSelection (j). Count = True really makes no sense because:

    1. The array returned by the multiple selection (using (j) indexing now refers to a single selected item in the list (which has not its own 'Count' property)

    2. If you don't the array index, assuming that you had selected 4 items in your list, your statement would still be actually as said if 4 = True which is not what you get.

    Make sense?

    Here is a modified version of your code that I hope makes it a little more obvious how these elements relate to one another.  Give it a run; of course, 75% of the code is extranneous to you working end to account, so make sure that you subsequently delete what you won't need.

    Sub loadData_EventClick (ByRef This) ' creates the event handler
    Dim j
    If ListBox.MultiSelection.Count = 0 Then Exit Sub
    TextBox.Text = "Total ListBox items:" & ListBox.Items.Count & + "" \n "".
    TextBox.Text = TextBox.Text & "Total selected items:" & ListBox.MultiSelection.Count & + "" \n "".
    TextBox.Text = TextBox.Text & "Selected Items:" & + "\n"
    For j = 1 to ListBox.MultiSelection.Count
    TextBox.Text is TextBox.Text & ListBox.MultiSelection (j). Text & ", index" & ListBox.MultiSelection (j). Index & + "\n"
    Next
    End Sub

    You are making great progress; It will get quickly easily faster and we are here to help – do not hesitate.

  • Multiple selection in string tree

    I make a tree with line 15, I set the selection to 1 or more. now, I want to make a multiple selection of tree to appear in control of the chain, how can I do this?

    Thank you

    Use the Value property:

    The order in "response" will be the order that items have been selected.

  • Can't get multiple selections of work ListView

    The example code here seems very simple:

    https://developer.BlackBerry.com/native/reference/Cascades/bb__cascades__multiselecthandler.html

    I use the code example to use with ListView as my model:

                ListView {
                    id: listView
                    objectName: "listView"
                    dataModel: photosModel.photoGridModel
    
                    snapMode: SnapMode.LeadingEdge
    
                    layout: GridListLayout {
                        id: gridListLayout
                        objectName: "gridListLayout"
                    }
    
                    onTriggered: {
                        var newPage = photosPageDefinition.createObject();
                        photosModel.setPage(newPage);
                        navigationPane.push(newPage);
                        navigationPane.peekEnabled = false;
                        photosModel.launchFullscreen(indexPath);
                    }
    
                    multiSelectAction: MultiSelectActionItem {}
    
                    multiSelectHandler {
                        // These actions will be shown during multiple selection, while this
                        // multiSelectHandler is active
                        actions: [
                            ActionItem
                            {
                                title: "Tag"
                                imageSource: "asset:///images/tag.png"
                                onTriggered: {
                                    // TODO
                                }
                            },
                            ActionItem
                            {
                                title: "Share"
                                imageSource: "asset:///images/share.png"
                                onTriggered: {
                                    // TODO
                                }
                            },
                            ActionItem
                            {
                                title: "Move"
                                imageSource: "asset:///images/folder.png"
                                onTriggered: {
                                    // TODO
                                }
                            },
                            DeleteActionItem
                            {
                            }
                        ]
    
                        status: "None selected"
    
                        onActiveChanged: {
                            if (active == true) {
                                console.log("Multiple selection is activated");
                            }
                            else {
                                console.log("Multiple selection is deactivated");
                            }
                        }
    
                        onCanceled: {
                            console.log("Multi selection canceled!");
                        }
                    }
                }
    

    When loading the application, I long press on an item in the GridView control and nothing happens.

    Can you clarify what this means 'does not '?.

    EDIT:

    OK, now I see. To make it work, you must set an empty or nonempty ActionSet for each listitem.

    StandardListItem {
        title: ListItemData.title
        contextActions: [
            ActionSet {
            }
        ]
    }
    

    Now, it will work.

Maybe you are looking for