Query output to multiple selection data

I am trying to output the name of the person and the Organization to which they belong. A user can belong to more than one org and org may have multiple users associated with them.

I have a table of user with user_id, username_txt, password_txt user_org_id fields
a table of org that has org_id and org_cd
a user_org table that has a user_org_id, user_id and org_id
This is how I create the relationship between users and organizations.

I'm trying out the name of a person and a multiple selection box that has all the orgs that is assigned to a user selected. but the form is to select only a single organization. How can ensure me that the selection box shows the user orgs selected?

I think I have to do some kind of loop or something else to get all values - I don't know what to do. any help would be appreciated. Thank you!

See my code:

With the help of a multiple selection with pre-selected items makes it very easy for users accidentally deselect things.

But, if you insist, change this:
SELECTED
to do this:
selected = "selected".

Tags: ColdFusion

Similar Questions

  • Is there a way to multiple selection data source in a Web App?

    I created two Web Apps. I'm trying to multiple selection of one of the lists.

    The idea is - I have a list of manufacturers and a list of distributors, a few hundred in each list. I would like to be able to set up a select field type 'data source' Web App Distributor and for that to be a function of multiple selection.

    Does anyone know how to do this?

    Web apps are only a 1 to 1 relationship, BC at this time doesn't support 1 to many, or many-to-many on web applications. If you can't sorry.

  • Automatic filling of multiple selection based on the selection list

    Hello

    I have a problem in filling multiple selection data in the selection list.
    I would like to take an example and explain.
    I have 3 tables: employee, Department and a link table for employee and department.
    The selection list contains employee and the Department is a multiple selection. Employee selection, all departments must be posted and belongs to the Ministry of which employee (which comes from the binding table) must be selected (high-lighted). How can I do this?

    HI 841762 :),.

    Do not use the 'style' to highlight that you would have found out by now that would make the blue text background while the font color remains black and this will make the text unreadable. Plus if there is a button on the page when you submit it to us, I doubt that it will store the State of the selected items in a multiple of P1_DEPT in session state. then try this...

    In the application process, replace, the status of 'style' that you used to highlight as you...

    ....
    If (rec.R=cnt)then
    htp.prn('');
    ELSE
      htp.prn('');
    end if;
    ...
    

    Then in the JS, use

    appendToSelect(list, l_Opt_Xml.getAttribute('value'), l_Opt_Xml.firstChild.nodeValue,l_Opt_Xml.getAttribute('selected'));
    

    and change the function "appendToSelect".

    function appendToSelect(pSelect, pValue, pContent,pIsSelected) {
    
     var l_Opt = document.createElement("option");
     l_Opt.value = pValue;
    
    if(pIsSelected)
    l_Opt.setAttribute('selected','selected');
    
    if(document.all){
      pSelect.options.add(l_Opt);
      l_Opt.innerText = pContent;
     } else {
      l_Opt.appendChild(document.createTextNode(pContent));
      pSelect.appendChild(l_Opt);
     }
    }
    
  • 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.

  • Add the data in a field of multiple selection?

    Just got got off the phone with the support of Eloqua ask about the possibility of adding data in a field of multiple selection over time. Apparently, it's possible through mailings of form, but no list will be mailed.  Wouldn't be great if during a download list, you had the ability to add data from a field in your file .csv for existing values in this area in Eloqua.  Here's a use case for this scenario... in our society of industry can be part of multiple market segments.  Depending on the event, a person can feel they are part of the market segment 'Radar', but another event specializing in Sonar... they indicate that they are part of the market segment "Sonar", both being true.  There is currently no easy way to enter these data in Eloqua over time as part of the downloads from the list.  Based on the scenario above, the existing value is 'Radar', but if "Sonar" is the value of the field for the next download it replaces the value of 'Radar '.  Ideally, we would be able to capture the two values.

    I said that if there is enough interest in this idea, Eloqua would consider developing a new option for downloads from the list add vs crush.  I hope others can find a use case for this idea.

    Hi Tina,

    I know it's a bit old but I had a simular problem on adding values to a multi select.  Here's how I approached it.

    1. Add a text based contact field Eloqua to transfer your csv values.  Let's call it "MultiSelect download Value" for this example.

    2. Add Eloqua add values to a multiselect contact field.  What we'll call "MultiSelect Final.

    3. create a program that will add the download list.

    4. in the program, create a step to update Contact data

    . in the update rule, update "Definitive MultiSelect' field, Append the value in the field value, value will be hardcoded, check use a delimiter": ", marks the conditional rule the field" value to download MultiSelect "equals the value hard coded or one that you would like the field to be.

    b. create all update settings you need for your data.

    I approached this way because our downloads from the list should be add the data over time.  The field ' value to download MultiSelect ' allows it to be overwritten on each download.

    Let me know if you want more details.

    Thank you

    Blake

  • query to select data valid

    Hi all

    IAM trying to extract data from a table that has 3 columns I need to select data, of the same c1, c2 values the c3 must be unique. If the value of c3 is different, so I need to reject these data.

    For example:

    Table
    C1 c2 c3
    123 21 July 12 4
    123 21 July 12 4
    125 23 July 12 6
    126 24 July 12 7
    126 24 July 12 7
    126 24 July 12 7
    126 24 July 12 10
    126 27 July 12 13
    126 27 July 12 13
    127 25 July 12 12
    127 25 July 12 12
    127 25 July 12 12


    Result:

    C1 c2 c3
    123 21 July 12 4
    125 23 July 12 6
    127 25 July 12 12
    126 27 July 12 13

    And the oracle 8i installation version.

    Please help me to write a query that takes less time to retrieve the data...


    Thanks in advance!


    -Kel

    Hi, Kel,

    Here's one way:

    SELECT       c1, c2
    ,       MIN (c3)     AS c3     -- see note
    FROM       table_x
    GROUP BY  c1, c2
    HAVING       COUNT (DISTINCT c3) = 1
    ;
    

    Note: because the selected groups will only have 1 value of separate c3, it does not matter if you display the MIN or MAX. they will always be the same.

    This assumes that c3 is not NULL. If c3 can be NULL, then the solution is a bit more complicated, but only a little.

  • Help with POST data if multiple selections are chosen

    I created a form with a menu (list) which includes all 50 States. I used the MESSAGE option, as well as PHP, to treat form data, which will be sent to me. The list menu looks like this: http://askdave.info/help/states_menu.gif and I have "Allow multiple selections" checked in the property inspector.

    If the user chooses several States, I want EACH of these States to be included in the email that I receive. Right now, if I check several States, I get only the latest state selected. For example, here is the email that I get after I check 5 different States. http://askdave.info/help/FormData.gif

    Problem-> in this email, only one State is indicated (Hawaii), even if I selected 5 different States. How can I get the data from the form to list all THE States that are checked?

    Here's what I have:

    < form name = "form1" method = "post" action = "process.php" >
    < input type = "hidden" name = "required" value = "name, phone, email, States, capital" / >

    And then for the menu that lists the States, I have:

    < label >
    < select name = 'States' size = '7' several id = 'States' >
    all States < option > < / option >
    Alabama < option > < / option >
    Alaska < option > < / option >
    Arizona < option > < / option >
    Arkansas < option > < / option >

    and so on...

    What Miss me? How can I get the PHP script to send multiple values, if multiple values are selected? (I'm new to PHP, so go easy on me.) I can post my code, if necessary.) Is this a PHP problem, or do I have to add something to the HTML form?

    Hello

    >>
    I think that DynaForm is synonymous with dynamic form
    >>

    This makes some sense ;-) I was wondering just because there is a pre-made script called DynaForm here, but it has a different 'Logistics' than yours.

    However, both "DynaForm" versions are pretty basic, because they deal only with non-multiple values - fields as a single line, texareas and select´s non-multiple of form input fields. Your script for example just loops through all the existing form fields using the method "foreach":

    Out of form fields and values.
    foreach ($this-> post as $field-online $value) {/ / loop through all form fields}
    If ($field == "required") continue;
    $this-> _addLine ($field, $value); Here´s where the field´s name/value consolidation happens
    }

    .. .and simply includes a 'value' with his 'name' associated field´s. The problem is: this method works, simply to have only 1 value - but any 'multiple value' form fields (for example your 'States' select or check box groups who spend several values as well) require a separate "foreach" in the script treatment, fields and this hasn´t been incorporated here.

    That said, I would suggest using another solution pre-made as PHP Form Mail script that s capable of managing your multiple values - scenario naturally.

  • How to use the multiple selection list values in sql query

    Hi all
    In the search form, I have a multiselect llist tell (P3_STATUS) and I want to have a query using this element and fetch documents
    How to do a sql query based on the selection of the value of this element.
    SELECT "W"."START_DT" "Start Date",
           "W"."CAMPAIGN_CODE" "Campaign Name",  
           "W"."MKT_CHANNEL" "Channel",
           "W"."MKT_SUB_CHANNEL" "Sub Channel", 
           "W"."PROMO_CODE" "Promo Code",
           "W"."TRACKING_CODE" "Tracking Code",
           "W"."TFN" "TFN",
           "W"."STATUS" "Status",
           "W"."CAMPAIGN_CODE" "Edit"
           FROM 
             "WC_MKT_CAMPAIGN_DS" "W"
      
           WHERE 
         (MKT_CHANNEL = decode(:P1_CHANNEL,'%null%',MKT_CHANNEL,NULL,MKT_CHANNEL,:P1_CHANNEL))
       AND
    (MKT_SUB_CHANNEL= decode(:P1_SUB_CHANNEL,'%null%',MKT_SUB_CHANNEL,NULL,MKT_SUB_CHANNEL,:P1_SUB_CHANNEL))
    AND *STATUS = decode(.................*
    Please could someone help me on this?

    Thanks in advance
    Robert L

    Try to change your selection of status to

    AND INSTR(':'||:P3_STATUS||':',':'||STATUS||':') > 0
    
  • Create the form for selecting data in multiple tables

    Hello

    I'm getting APEX for the first time and I just read 2 days dev Application Express guide

    I tried to play and I can't create a report with the form that select data from several tables

    What I want to achieve is a report we'll say 'USERS' makes MANAGER_ID ID, NAME, with a form that allows me to create, delete, change users

    The problem is that, once the report with the form created, if I click on create (to create a user) it will ask me for id, name, and manager_id

    I need a water drop down which allows me to select managers in the table manager instead of manually insert Director id

    How do I do that?

    Thank you!

    HI Chris,

    LOV will use this magic.

    Search:

    Kind regards

    BEnjamin

  • 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

  • Insert a blank line in the query output

    Is it possible to insert a blank line between two rows of the query output?

    In the EMP table, the column LINES is as follows:

    LINES
    1
    2
    3
    4
    1
    2
    3
    1
    2
    3
    4
    5

    I want to insert a blank line after every 1

    Please suggest.

    Sanjay

    I'm quite puzzled why you need rows in the dataset returned by a select statement that is empty.
    If you are using Oracle reports to the release date, you define the presentation of the report to have spaces between the rows returned by the select and have do not need to have the select statement returns a blank line after each line of data. If the output should be obtained by using another client, I think that the customer will have facilities for output formatting.

    Admit that you really need "blank lines" between data lines, I see only one way: use a temporary table and do an insert into select temporary_table (...) ... from... where... Then, in this temporary table, you can insert 'empty rows', which is actually not really empty, because they must have some fields that give the order of the rows. And then select in temporary_table, you place your order by the columns that are used to give the order for the release.
    Thus

    insert into temporary_table (
    ....
    )
    select ...
    from ...
    where ...
    ;
    for r in (
    select col1, col2, col3  -- columns used for order by
    from temporary_table
    order by col1, col2, col3
    )
    loop
      insert into temporary_table (col1, col2,col3, col4)
      values (r.col1,r.col2,r.col3, null);
    end loop;
    -- this way, a select * from temporary_tabel order by col1, col2, col3, col4 will return a blank row after each data row
    
  • Multiple selection box is not showing is not the values passed to grid?

    ColdFusion 8

    I've inherited an application and I try to maintain and improve the it hit... clings today.

    I have a multiple selection box that does not what to expect.  The values come from a ColdFusion grid, which is based on a database query.

    Here is the code for the select - doesn't work - nothing is selected:

    < cfselect name = "USER_IDS" multiple = "true" = "below" selected = queryposition query "USER_IDS' = 'ActiveUsersPlus' disabled = value" "disabled #" = "G_USER_WORK_UNIT_SK" display = "G_USER_ID" > "

    < / cfselect >

    Now if I change the multiple selection of a single select as below - it takes the first element in the list of the fields (from the grill) and selects it in the drop-down menu.

    < cfselect name = "USER_IDS" multiple = "false" queryposition "below" selected = query "USER_IDS' = 'ActiveUsersPlus' disabled = value" "disabled #" = "G_USER_WORK_UNIT_SK" display = "G_USER_ID" > "

    < / cfselect >

    Or if I assign a variable like this and use the code of multiple selection it seems to work as well.

    testlist = '22,26'

    ...

    "< name cfselect ="USER_IDS" multiple ="true" ="under"queryposition selected =" "#testlist # ' = 'ActiveUsersPlus' disabled = value query" disabled # "="G_USER_WORK_UNIT_SK"display ="G_USER_ID">

    < / cfselect >

    I posted "User_IDs" value in the grid and in the part data entry screen to see the values of: 22,26

    to make sure it wasn't my problem.

    Grids and multiselects need something more?  Any advice on how to fix?

    Problem was the bit of javascript for the area of selection.  There is a function for an only select box but not a box selection - this fixed it:

    If (theForm.elements [i] .Guy == "select-multiple") {}

    selectBox var = theForm.elements [i];

    var sbname = selectBox.name;

    CPValue = String (eval ('record.data.)) ((' + sbname));

    var NotifyArray = cpvalue.split(',');

    for (var j = 0; j)< selectbox.length;="" j++)="">

    selectBox [j] .selected = false;

    }

    for (var j = 0; j)< selectbox.length;="" j++)="">

    sbvalue = selectBox [j] .value;

    for (var k = 0; k)< notifyarray.length;="">

    If (sbvalue is {NotifyArray [k])}

    selectBox [j] .selected = true;

    }

    }

    }

    }

  • How to export select data from table in the file?

    Hello..

    Here's my query to select data in 2 tables and I join help call_id column: -.

    Select n.nbr_calling, n.nbr_called, c.tec, n.conversation_duration
    of albn_ngnsm_280110 n, albc_ngnsm_280110 c
    where c.call_id = n.call_id
    and c.route_to_arbor = 1;

    The problem is what is the query to export all the output in text files?


    Thank you
    Balleur

    Hello

    set echo off
    set heading off
    set pagesize 0
    set linesize 150
    
    spool D:\file.csv
    SELECT Query
    spool off
    

    Thank you
    Ankur

  • Problem Manager multiple selection with system dialog box

    I currently have a problem with the help of system on a manager of multiple selection dialog as the code below works fine:

    multiSelectHandler {
                        status: listView1.selectionList().length + qsTr(" Clients Selected") + Retranslate.onLocaleOrLanguageChanged
                        actions: [
                            DeleteActionItem {
                                id: deleteActionItem
                                onTriggered: {
                                    var selectionList = listView1.selectionList();
                                    var selectedItem = dataModel.data(selectionList);
                                    console.log(selectedItem);
    
                                    for (var i = 0; i < selectionList.length; ++ i) {
                                        _sql.deleteClient(dataModel.data(selectionList[i]).clientID)
                                        dataSource.loadData()
                                    }
                                }
                            }
                        ]
                    }
    

    However, when it is changed to use that a dialogue system, the feature does not work and the console record results:

    selected list: undefined

    selected item: undefined

    multiSelectHandler {
                        status: listView1.selectionList().length + qsTr(" Clients Selected") + Retranslate.onLocaleOrLanguageChanged
                        actions: [
                            DeleteActionItem {
                                id: deleteActionItem
                                onTriggered: {
                                    multiSelectDeleteDialog.show()
                                }
                                attachedObjects: [
                                    SystemDialog {
                                        id: multiSelectDeleteDialog
                                        title: qsTr("Delete Clients") + Retranslate.onLocaleOrLanguageChanged
                                        body: qsTr("Are you sure you want to delete these clients?") + Retranslate.onLocaleOrLanguageChanged
                                        onFinished: {
                                            if (result == 3) {
                                                console.log("Cancelled")
                                            } else {
                                                console.log("Deleted")
                                                var selectionList = listView1.selectionList()
                                                console.log("selected list: " + selectionList)
                                                var selectedItem = dataModel.data(selectionList);
                                                console.log("selected item: " + selectedItem);
    
                                                for (var i = 0; i < selectionList.length; ++ i) {
                                                    _sql.deleteClient(dataModel.data(selectionList[i]).clientID)
                                                    dataSource.loadData()
                                                }
                                            }
                                        }
                                    }
                                ]
                            }
                        ]
                    }
    

    With the help of Roger Leblanc, it works now

    multiSelectHandler {
                        status: listView1.selectionList().length + qsTr(" Clients Selected") + Retranslate.onLocaleOrLanguageChanged
                        actions: [
                            DeleteActionItem {
                                property variant selectionList
                                property variant selectedItem
                                id: deleteActionItem
                                onTriggered: {
                                    deleteActionItem.selectionList = listView1.selectionList()
                                    deleteActionItem.selectedItem = dataModel.data(selectionList);
                                    multiSelectDeleteDialog.show()
                                }
                                attachedObjects: [
                                    SystemDialog {
                                        id: multiSelectDeleteDialog
                                        title: qsTr("Delete Clients") + Retranslate.onLocaleOrLanguageChanged
                                        body: qsTr("Are you sure you want to delete these clients?") + Retranslate.onLocaleOrLanguageChanged
                                        onFinished: {
                                            if (result == 3) {
                                                console.log("Cancelled")
                                            } else {
                                                console.log("Deleted")
    
                                                for (var i = 0; i < deleteActionItem.selectionList.length; ++ i) {
                                                    _sql.deleteClient(dataModel.data(deleteActionItem.selectionList[i]).clientID)
                                                    dataSource.loadData()
                                                }
                                            }
                                        }
                                    }
                                ]
                            }
                        ]
                    }
    
  • Need to field multiple select the option without having previously selected deleted

    Hi all

    Request Express 4.1.1.00.23

    Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production

    I have a requirement of adding a field of multiple selection to a single screen, and I added the list to multiple selection, without a second thought. Of course, the question is when a user tries to edit a record, click on (with the CTRL key) two options in the selection list multiple, but not clicked on those previously selected, then we lost them. Then I thought to create checkboxes and thus those already selected will be always checked when try to update.

    But I want to do with the multiple selection field. So I was wondering if there is a way?

    Thank you!

    Sam82 wrote:

    Request Express 4.1.1.00.23

    Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production

    I have a requirement of adding a field of multiple selection to a single screen, and I added the list to multiple selection, without a second thought. Of course, the question is when a user tries to edit a record, click on (with the CTRL key) two options in the selection list multiple, but not clicked on those previously selected, then we lost them. Then I thought to create checkboxes and thus those already selected will be always checked when try to update.

    But I want to do with the multiple selection field. So I was wondering if there is a way?

    This is the behavior expected multiple-selection list. It can be changed using a point hidden shadow and JavaScript, but there is no way out of the box to achieve what you propose.

    Selections several lists are usually a bad idea:

    • Users do not know how they work
    • They are confused and source of errors, except if all options are visible (which generally wastes space UI)
    • The resulting values of treatment is problematic
    • They are often the cause of a model of incorrect data or result

    Checkboxes or a shuttle are much better options and controls for multiple choice options.

Maybe you are looking for

  • Permanent PIN on photos icons

    Somehow in topic: newtab page has each visible thumbnail both pins (PIN icons; Remove) as if I have all hovered them at the same time. I tried to uninstall, install, create new profile, but the problem persists. Here is a screenshot: https://DL.dropb

  • Tecra A8 PTA83A - Vista 32 bit drivers needed

    Hello I'll try to find the drivers (Vista 32 bit) for this computer laptop pta83a - 04g 012. However, I can not even find the laptop on the Australian site. In fact I can't find anywhere what "A8" laptops at all. http://www.MyToshiba.com.au/support/d

  • What is the probability that I have a virus if one of my folders disappeared?

    What is the probability that I have a virus if one of my folders disappeared? The only thing I did was to do a clean up to make room. Original title: Virus?

  • Code to update windows error 8007371B (KB2736233)

    tried to install twice with the same result Update Rollup for ActiveX Killbits for Windows Vista x 64 KB2736233

  • Failure of the b Windows Vista 64 update: (code 80050007)

    Update windows 64B is now impossible because I see an 80050007 error code. I tried to work on my admin account, but even who could not fix this update. On the internet, I've seen a lot of questions unanswerd (UAC) for a problem like this.I even clean