Multi-select lists, their return values and showing their display value

I have a multi select list which is dynamic. The display and return values are pulled from a table where the return value is the Primary Key.
When people select a few options, the value is stored in session state as 11:12:13 (etc...). From here, I run these numbers through a process which takes a report ID and the multi-select string, and saves individual rows as Report_id, individual multi select value until there are no more multi select values.
This is great, they're tied in as a foreign key to the LOV lookup table, and they are easily search able.
I have trouble where I want to list a report's entire multi-select list. I have a function combine the numbers with a : in between them and RTRIM the last one, so I have an identical string to what a multi-select table uses. 11:12:13 (etc..)
When I assign it to display as an LOV in a report, it just shows the 11:12:13 instead of listing out the values.
Single number entries, where someone only selected one option in a multi select, display fine.
Am I doing this wrong?

Scott - you're right on the money. I did this initially because I thought assigning an LOV display value to a report column would yield the results I wanted.
I want to do this without referring to the original table... meaning I don't want a function to have to go out and get the names, I'd like my LOV assignment to do it. This saves headache of having to change something in 2 places if it ever changed.
Am I not going to be able to do this?
I created a test multi-LOV page, it doesn't work with original(not processed in my function) LOV assignments either, unless you only select one.

Similar Messages

  • How to make a select list to return value to numeric column?

    I do have a select list with static values (STATIC:01;0,02;1,03;2,04;3,05;4,06;5,07;6,08;7,09;8,10;9). The problem is that I am returning a value to a numeric column. Therefore I have set 'Post Calculation Computation' as "to_number(:P73_MRGRATING, 9);" however I am getting ORA-01722: invalid number. How, (or when and where) to properly convert a character from a select list representing a numeric value into column of NUMBER data type?
    Thank you for your time.
    DanieD

    Sergio,
    It is because I am not able convert a value in a page item (:P73_ID) to number. On a page before, I have assigned a value to an application item (APPL_ID). On page 73, I want to assign the value in APPL_ID to the page item P73_ID . The value assigned to APP_ID is numeric. On a page 73 I also have a computation in Page processing section. It is an 'After Submit' processing of a static assignment of application item APPL_ID to page item P73_ID. Unfortunately it does not work. (ORA-01722: invalid number). I have tested this also with a 'Post Calculation Computation' on page item P73_ID (to_number(:P73_ID, 9999999999);) and I am still getting ORA... error. Only way I can make it work is to create a page item P73_ID as a text field, then when I run page 73 and enter a value into P73_ID manually - then it works and I can save the values from the form into database...
    The strange thing is that I am using application item APPL_ID on a couple of pages, in where clauses and it always works, even when I am comparing APPL_ID against a numeric value like select * from a_table where some_number = :APPL_ID, this works. But when I would like to create an entry form and assign application item APPL_ID to the page item P73_ID that is referencing a numeric table column – then I am getting ORA-01722…
    Is there any application (sample application) that is doing this and it works so I can check it and learn how to create this process appropriately?
    Thank you for your time.
    DanielD

  • Reporting on a Multi-Select list field X:Y:Z

    I'm sure someone must have come across this problem but I can't find a reference to it on the forum.
    PROBLEM
    I have a data entry form with multi-select lists. Users choose a number of display values and the return values are stored in the field in the format
    20:30:50
    When I create an SQL report on a row, there is no option to Display the column as a "multi-select list" like there is with a standard List of Values.
    How do I report the display lookup values rather than the return code?
    Is it possible to display the selected values in a report for example
    red
    orange JOHN 10-JAN-07
    green
    red
    orange MARY 12-FEB-07
    orange
    green MARK 13-JUL-07
    regards
    Paul P

    Paul,
    I have several examples on this topic:
    http://htmldb.oracle.com/pls/otn/f?p=31517:87
    http://htmldb.oracle.com/pls/otn/f?p=31517:84
    http://htmldb.oracle.com/pls/otn/f?p=31517:75
    Basically, you will need to create a table out of your colon separated values and then
    join this table with other tables to be able to display it however you want.
    What just comes to my mind is that Dietmar presented a nice workarround for a similar
    problem here:
    Nested report howto?
    Denes Kubicek

  • Pass values fromSharePoint list multi-selection list box to Infopath Multi-selection list box and back

    Design overview:
    List A
    InfoPath Library - Form A
    SharePoint Designer workflow
    List A has a multi-selection column with multi-values.
    Form A has fields populated from the data in List A by using a data connection in the form.  I have a workflow that updates the values or creates a new item in List A. All fields work except the mufti-selection. The multi-selection has ;# separating
    the values and I am having trouble setting the list box properly(checking of the selecting values) instead it concats all values on one line. I basically need to get the multi-selection column from list 1  to show exactly in the Form A and be able to
    update the selection with the workflow. I can do this with single values with no problem. the multi-selection list is difficult. I read somewhere I can use a repeating table but I am not sure the workflow will work with that. That is only a read and not 
    a write.

    Wow over my head a little. I understand what an array is with script but not how to write the script to handle it. I made this:
    event.value = getField("LISTBOX").value;
    But still no change in the behavior with multi selections. Example below if you want to check it out.
    https://dl.dropboxusercontent.com/u/2944617/formtext2.pdf

  • Set Default Value of Multi-select list item

    I have a multi-select list item I want to default the value of to '%' (which is really '%null%') and have it selected. I tried setting default value of item, but it doesn't take '%null%'. I also tried a computation with a static of
    :P507_ITEM := '%null%'; How do you get the default value set and selected?

    Hi
    Shijesh is right, you need to change your null return value and use that return value as your default. Try and use something of the same datatype as your real return values if you plan to use '%' to display all as it will make your queries simpler. eg.
    Company A returns 1
    Company B return 2
    % returns 0
    Then your query would be...
    SELECT ...
    FROM ...
    WHERE company_id = DECODE(:P_COMPANY,1,1,2,2,0,company_id)
    Hope this makes sense.
    Cheers
    Ben

  • Select multiple values in mult-select list

    I have the following query as the source for a multi-select page item:
    SELECT person.person_id
    FROM person, pers_proj_task
    WHERE pers_proj_task.person_id = person.person_id
    AND pers_proj_task.project_id = :P3_PROJECT_ID
    The query returns two records and the page item's session value is 4:3, but only the value 4 is highlighted in the mulit-select list. How can I get both values to be highlighted?

    Got it to work for a multi-select item by following Dimitri's post which uses a shuttle example. It was still only highlighting one value, but I tried Patrick Wolf's suggestion from the comments on Dimitri's post to put the pl/sql block in the source of the item rather than as a computation and it worked.
    So I now have a multi-select list which has default values pulled from a LOV. The items that are highlighted by default are selected by using the following pl/sql block in the "source/value or expression" of the :P3_PERSON_ID multi-select item:
    declare
    person_list apex_application_global.vc_arr2;
    i number := 1;
    begin
    for r in ( SELECT person.person_id
    FROM person, pers_proj_task
    WHERE pers_proj_task.person_id = person.person_id
    AND pers_proj_task.project_id = :P3_PROJECT_ID)
    loop
    person_list(i) := r.person_id;
    i := i + 1;
    end loop;
    return APEX_UTIL.TABLE_TO_STRING(person_list,':');
    end;
    Thanks to Amanda, ArtS, Dimitri and Patrick.
    Jeremy

  • Multiple Select List not returning multiple values

    I have created a Multiple Select List, and the manual says that when multiple values are selected and the page is submmitted (I'm using a GO button), the multiple values are put into the ITEM field, separated with a colon . However, whenever I select multiple entries in my list, it only ever returns a value for the first item (like a single select list).
    Does anybody know what I may have missed ? I'm still fairly new to this stuff, so I'm hoping it's fairly simple!
    thanks.
    p.s I'm using a dynamic list of values.

    Andy / Scott,
    Sorry, please bear with me ... still new to this.
    I have a multi select list item in page 2, called P2_MULTI_LIST. When the page is submitted, I no longer physically pass it to page 3, but how would page 3 pick up the value ? Do I need to set up a P3_MULTI_LIST item in page3 and set that item to the P2_MULTI_LIST value, or do I reference P2_MULTI_LIST directly in my Page3 SQL query ?
    Also, if I then want to propogate the value in P2_MULTI_LIST down to another page from page3, via a link in a report, is this possible ?
    thanks
    Tim

  • Select list with URL redirect - not showing the same display value selected

    Hi
    I have several select lists with URL direct on my page similar to this
    for p6_queries item the LOV is
    select QUERY_NAME display_value, 'f?p='
    || :APP_ID
    || ':'
    || 6
    || ':'
    || :APP_SESSION
    || '::::p6_queries:'||QUERY_ID||'#qtables' return_value from .....
    I am assigning a return value to the item p6_queries. But when the page is redirected, I dont see the selected value as selected in the list. Instead it goes to the null display text. Can any one help me on this?

    The problem is that your setting the item value to value of query_id. But your select list has the value of each item as the URL so it will never match and show you what you selected.
    The best thing to do may be to change your select list from a "redirect to URL" to "submit page", make it a normal query:
    select QUERY_NAME display_value, QUERY_ID return_value ...
    Then create an "On Submit: Before Computation" branch:
    Target Type: URL
    URL Target: f?p=&APP_ID.:6:&SESSION.::&DEBUG.::P6_QUERIES:&P6_QUERIES.#testing
    Condition Type: Request = Expression 1
    Expression 1: P6_QUERIES

  • How Do I Filter a Report Using a Multi Select List Box and Specifying Date Between Begin Date and End Date

    Hope someone can help.  I have tried to find the best way to do this and can't seem to make sense of anything.  I'm using an Access 2013 Database and I have a report that is based on a query.  I've created a Report Criteria Form.  I
    need the user to be able to select multiple items in a list box and also to enter a Begin Date and End Date.  I then need my report to return only the records that meet all selected criteria.  It works fine with a ComboBox and 1 selection but can't
    get it to work with a List Box so they can select multiple items.  Any help is greatly appreciated while I still have hair left. 

    The query should return all records.
    Let's say you have the following controls on your report criteria form:
    txtStart: text box, formatted as a date.
    txtEnd: text box, formatted as a date.
    lbxMulti: multi-select list box.
    cmdOpenReport: command button used to open the report.
    The text boxes are used to filter the date/time field DateField, and the list box to filter the number field SomeField.
    The report to be opened is rptReport.
    The On Click event procedure for the command button could look like this:
    Private Sub cmdOpenReport_Click()
    Dim strWhere As String
    Dim strIn As String
    Dim varItm As Variant
    On Error GoTo ErrHandler
    If Not IsNull(Me.txtStart) Then
    strWhere = strWhere & " AND [DateField]>=#" & Format(Me.txtStart, "yyyy-mm-dd") & "#"
    End If
    If Not IsNull(Me.txtEnd) Then
    strWhere = strWhere & " AND [DateField]<=#" & Format(Me.txtEnd, "yyyy-mm-dd") & "#"
    End If
    For Each varItm In Me.lbxMulti.ItemsSelected
    strIn = strIn & "," & Me.lbxMulti.ItemData(varItm)
    Next varItm
    If strIn <> "" Then
    ' Remove initial comma
    strIn = Mid(strIn, 2)
    strWhere = strWhere & " AND [SomeField] In (" & strWhere & ")"
    End If
    If strWhere <> "" Then
    ' Remove initial " AND "
    strWhere = Mid(strWhere, 6)
    End If
    DoCmd.OpenReport ReportName:="rptMyReport", View:=acViewPreview, WhereCondition:=strWhere
    Exit Sub
    ErrHandler:
    If Err = 2501 Then
    ' Report cancelled - ignore
    Else
    MsgBox Err.Description, vbExclamation
    End If
    End Sub
    If SomeField is a text field instead of a number field, change the line
            strIn = strIn & "," & Me.lbxMulti.ItemData(varItm)
    to
            strIn = strIn & "," & Chr(34) & Me.lbxMulti.ItemData(varItm) & Chr(34)
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • On button click of Infopath forms select multi select list box values...

    Hi,
    We have multi select list box on one of the info path forms. We have placed on button on this form. If user clicks on this button we want to select some of the values in Multi select list box (check box).
    Is it possible if yes how can we achieve it?
    Thanks.
    Regards,
    Amit Chhatbar

    Hi Amit,
    From your description, you would like to check items in a multi-selection box when a button is clicked.
    I’d recommend you make use of rules in InfoPath form, i.e. when button is clicked, then set a field’s value.
    However, if you are using multi-selection box, then you could only set the value of one item at a time. If you want to select several items at once, then we could use code. For more information:
    http://www.bizsupportonline.net/blog/2009/07/understanding-multiple-selection-list-box-infopath/
    http://www.bizsupportonline.net/infopath2007/programmatically-select-all-items-multi-select-list-box.htm
    If you are using several check boxes to replace multi-selection box, then it will be more easy. The rule could be that when this button is clicked, set a field’s value (check box field) to true and repeat it.
    Regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected] .
    Rebecca Tu
    TechNet Community Support

  • Alternate select lists on 2 columns and return more than 1 column

    Hi,
    I try to build 2 alternate select lists and each select list should return more than 1 column
    2 Columns PART_ID and PART_SPECIFICATION
    Now I build a select list on PART_ID like
    select part_id d,part_id r from parts;
    The result should be:
    Column PART_ID has PART_ID and PART_SPECIFICATION must be text of PART_SPECIFICATION
    The other select list based on PART_SPECIFICATION should be like
    select part_specification d,part_id r from parts;
    Now it should be displayed part_specification in PART_SPECIFICATION and part_id in PART_ID.
    This is because one user knows the part_id and another knows only the specification
    Please help me
    Siegwin

    Hi Siegwin,
      Check your application Page 7(copy of page 500)  using select list instead of plugin, it gives all values.
    and works very well,
    use ajax process to get Xml data into page items
    following are changes
    application process: getData
    application item : TEMPORARY_APPLICATION_ITEM
    create one function in page html header pull_multi_value()
    and it call on page item p7_empno on html form element attribute as onchange="pull_multi_value(this.value)";
    this may Helps you,
    Pars.

  • Bug while saving multi select list

    Hi,
    My requirement is to construct a region where user can select their answer from available option. answer field can be multiple select/single select or text area.
    I have written below query to achieve different type of answer field.
    /**query****/
    DECLARE
    v_sql VARCHAR2 (32767);
    v_answer VARCHAR2 (32767);
    v_main_sql VARCHAR2 (32767);
    BEGIN
    FOR cur IN (SELECT question_id, question, answer_type, available_answer FROM question WHERE status= 'ACTV')
    LOOP
    v_sql := 'SELECT ';
    v_sql := v_sql || ' APEX_ITEM.hidden(4,question_id)||question question, '; /*do not show question id as per requirement*/
    IF cur.answer_type = 'MS' -- Multi Select List
    THEN
    v_answer := cur.available_answer;
    v_sql :=
    v_sql
    || ' APEX_ITEM.SELECT_LIST_FROM_QUERY(3,null,''SELECT * from table(
    AU_F_LOV_FN('''''
    || v_answer
    || '''''))'',''class="multiselect" multiple="multiple"'',''NO'') Answer ';
    ELSIF cur.answer_type = 'SS'
    THEN -- Single Select List
    v_answer := cur.available_answer;
    v_sql :=
    v_sql
    || ' APEX_ITEM.SELECT_LIST_FROM_QUERY(3,null,''SELECT * from table(
    AU_F_LOV_FN('''''
    || v_answer
    || '''''))'') Answer ';
    ELSE -- Free text
    v_sql := v_sql || ' apex_item.textarea(3,available_answer,2,20) Answer ';
    END IF;
    v_sql := v_sql || ' from question ';
    v_sql := v_sql || ' where question_id=' || cur.question_id;
    IF v_main_sql IS NULL THEN
    v_main_sql := v_sql;
    ELSE
    v_main_sql := v_main_sql ||' UNION ' || v_sql;
    END IF;
    END LOOP;
    RETURN v_main_sql;
    END;
    /***end of query***/
    If I select two options from multiple select list it is saving two records into table instead of saving one record with colon delimeter.
    /**query to save**/
    FOR i IN 1 .. APEX_APPLICATION.G_F03.COUNT
    LOOP
    IF APEX_APPLICATION.G_F03(i) IS NOT NULL THEN
    UPDATE question_answer
    SET answer = v_answer
    WHERE question_id = APEX_APPLICATION.G_F04(i)
    and call_id=p_sourceid;
    IF sql%rowcount =0 then
    INSERT INTO question_answer (question_id,
    answer,
    call_id,
    status,
    customer_id)
    VALUES (APEX_APPLICATION.G_F04(i),
    nvl(v_answer,APEX_APPLICATION.G_F03(i)),
    p_sourceid,
    'ACTV',
    p_customer_id);
    END if;
    END IF;
    END LOOP;
    /**End**/
    Can anyone please help me? Why is it happening? How to tweak my query so that it saves one record with colon delimeter.

    Technically, my understanding is that a Shuttle is just two multiselect lists where javascript moves the items from one to the other. Technically its the same thing, just different presentation and methods for selection. When you go to process, its seen the same way as you initially had your code setup so no code changes would have been necessary. As it's a built in item type and with APEX's backwards compatibility policies, if your code works now it should continue to work.

  • Implementing multi-select lists in Oracle Forms

    Can anyone of you please tell me how to do multi select list in forms. I used picklist.fmb from oracle demo forms but it is not working fine. If someone could provide a working form I will be grateful to them.
    My mail id is [email protected]

    Some years ago I wrote (using Forms6i) utility MSLOV for such purposes, and even wrote an article about using it, but, of course, in Russian :-)
    I successfully use it in my Web Forms6i project and also test it in C-S Forms6i and Forms9i.
    If someone interesting, I also have short english usage description.
    It will be nice to hear your comments.
    At first, you need a code, which can be downloaded from http://www.geocities.com/luzanovp/mslov.html
    At the end of article there is a link to mslov.zip. Get it.
    Compile MSLOV.fmb and MSLOV.pll
    Run demo forms: EMP_DEMO.fmb, ORD_DEMO.fmb and see how it works.
    It requires Scott's tables: emp, dept, ord, item, product. You can create these tables from demobld.sql
    Below description about how to use it.
    You can show to user only one column, actually it can be expression (so, you
    are not limited here to one database column only ).
    Specify this column/expression by label_in parameter to fp_mslov.show_lov
    For example, if EMP table contains first_name and last_name columns and
    you want to show to the user full name do this:
    IF fp_mslov.show_lov (
       label_in => 'first_name || '' '' || last_name',
    Parameter id_in - this is what will be returned to you as a developer after user
    made his choice.
    For example, you want to receive array of EMPNO:
    IF fp_mslov.show_lov (
       label_in => 'first_name || '' '' || last_name',
       id_in => 'empno'
    In some cases you need to return more that one column.
    You can specify up to five additional columns for such purposes.
    For example, you want to return not only EMPNO, but also SAL and COMM columns:
    IF fp_mslov.show_lov (
       label_in => 'first_name || '' '' || last_name',
       id_in => 'empno',
       col1_in => 'sal',
       col2_in => 'comm'
    Also, you can use expressions in place of these columns:
       col3_in => 'sal + NVL(comm, 0)'
    From which table we must query?
    How to order by or specify some conditions(Where clause)?
    Where the place for GROUP BY?
    For all these questions you must use from_clause_in parameter.
    In our example we will query emp table and want order by salary in descending
    order:
    IF fp_mslov.show_lov (
       from_clause_in => 'FROM emp ORDER BY sal DESC',
    Parameter title_in to fp_mslov.show_lov is a self documented.
    This is a title for MSLOV dialog.
    So, to invoke mslov utility, we construct such call:
    IF fp_mslov.show_lov (
       label_in => 'first_name || '' '' || last_name',
       id_in => 'empno',
       col1_in => 'sal',
       col2_in => 'comm'
       col3_in => 'sal + NVL(comm, 0)',
       from_clause_in => 'FROM emp ORDER BY sal DESC',
       title_in => 'Select employees'
    THEN
    This function fp_mslov.show_lov will return TRUE if user made selection and
    FALSE if user press CANCEL (similar to SHOW_LOV builtin).
    Now, if it return TRUE we need to process returned rows (selected by user).
    I store it in global record group.
    But to work with this record group, you can use fp_mslov package, which
    provide desired API for this purpose.
    At first, you need to declare a variable of FP_MSLOV.OUT_RECORD_TYPE type.
    Actually this is a record type declared in fp_mslov package specification.
    DECLARE
       returned_rec  FP_MSLOV.OUT_RECORD_TYPE;
    To process selected rows we need a loop from 1 to a number of selected rows.
    Such number can be received by fp_mslov.rowcount function:
    FOR i IN 1 .. fp_mslov.rowcount
    LOOP
    END LOOP;
    To return one row we can use fp_mslov.get_row function.
    FOR i IN 1 .. fp_mslov.rowcount
    LOOP
       returned_rec := fp_mslov.get_row(i);
    END LOOP;
    Now, you can do what you want with returned row.
    RETURNED_REC record has the following fields which correspond to parameters of
    the
    fp_mslov.show_lov function: id, col1, col2, col3, col4, col5
    You know that in id field will be empno column, in col1 -> sal, etc
    So, you can process them:
    FOR i IN 1 .. fp_mslov.rowcount
    LOOP
       returned_rec := fp_mslov.get_row(i);
       message('Empno: ' || returned_rec.id);
       message('Sal: ' || returned_rec.col1);
       message('Comm: ' || returned_rec.col2);
       message('Sal+Comm: ' || returned_rec.col3);
    END LOOP;
    Remember that returned values always are varchar2 values.
    So if you need, for example, a date you need explicitly convert it to char when
    invoking
    fp_mslov.show_lov and then (after fp_mslov.get_row) convert it to date with the
    same format mask.
    For example:
       IF fp_mslov.show_lov (
          col4_in => 'TO_CHAR(hiredate, ''DD.MM.YYYY HH24:MI:SS'')',
       ... TO_DATE(returned_rec.col4, 'DD.MM.YYYY HH24:MI:SS');
    To clear memory structures which used by global record group and others
    variables,
    you need to use fp_mslov.clear procedure.
    And now all together:
    DECLARE
       returned_rec  FP_MSLOV.OUT_RECORD_TYPE;
    BEGIN
       IF fp_mslov.show_lov (
          label_in => 'first_name || '' '' || last_name',
          id_in => 'empno',
          col1_in => 'sal',
          col2_in => 'comm'
          col3_in => 'sal + NVL(comm, 0)',
          from_clause_in => 'FROM emp ORDER BY sal DESC',
          title_in => 'Select employees'
       THEN
          FOR i IN 1 .. fp_mslov.rowcount
          LOOP
             returned_rec := fp_mslov.get_row(i);
             message('Empno: ' || returned_rec.id);
             message('Sal: ' || returned_rec.col1);
             message('Comm: ' || returned_rec.col2);
             message('Sal+Comm: ' || returned_rec.col3);
          END LOOP;
       ELSE
          NULL; -- User press Cancel
       END IF;
       fp_mslov.clear;
    END;

  • Using Multi Select List in SQL Query

    Hi all,
    I am trying to using a Multi Select list for filtering of a report. I have :P2_RISK_SEVERITY which has has the possibility of values Very Low:Low:Medium:High:Very High. How do I use this Multi Select in the where section of a SQL query?
    I need to say something along the lines of:
    Select RISK_SEVERITY from TBL_RMD_RISKS where RISK_SEVERITY = (one of the options selected in the multi select)
    Thanks for the help.

    Hi there,
    The above suggestion will work perfectly as long as the table you're querying is relatively small, but keep in mind that applying the INSTR to the left side of the WHERE clause will always result in a full table scan. This means that if your table is large and RISK_SEVERITY is indexed, the index will never be used. Here is another approach (credit to AskTom) that converts your colon-delimited string of selected values to a list that can be used in an "IN(...)" clause, which will use an index on RISK_SEVERITY as long as the optimizer otherwise deems it appropriate:
    -- creates a type to hold a list of varchars
    CREATE OR REPLACE TYPE vc2_list_type as table of varchar2(4000);
    -- converts a colon-delimited string of values to a list of varchars
    CREATE OR REPLACE FUNCTION vc2_list(p_string in varchar2)
       return vc2_list_type is
       l_string       long default p_string || ':';
       l_data         vc2_list_type := vc2_list_type();
       n              pls_integer;
    begin
       loop
          exit when l_string is null;
          n := instr(l_string, ':');
          l_data.extend;
          l_data(l_data.count) := ltrim(rtrim(substr(l_string, 1, n - 1)));
          l_string := substr(l_string, n + 1);
       end loop;
       return l_data;
    end vc2_list;
    -- your WHERE clause
    where risk_severity in(
             select *
               from the(select cast(vc2_list(:P2_RISK_SEVERITY) as vc2_list_type)
                          from dual))
    ...Hope this helps,
    John

  • Populate multi select list  in on demand application process

    Hi all,
    To populate a multi select list we use this code:
    DECLARE
    l_counter number;
    l_o_name varchar2(2000);
    l_val varchar2(100);
    BEGIN
    l_val := wwv_flow.g_x01;
    owa_util.mime_header('text/xml', FALSE );
    htp.p('Cache-Control: no-cache');
    htp.p('Pragma: no-cache');
    owa_util.http_header_close;
    htp.prn('<select>');
    FOR rec IN (
    SELECT DISTINCT DECODE(districtscode,NULL,'- Onbekend -',districtscode) as "NAME"
    , DECODE(districtscode,NULL,'-2',districtscode)as "ID"
    FROM table
    WHERE (UPPER(dienstcode) =(l_val)
    or l_val = '-1')
    and objectsubcategorie_id in (select objectsubcategorie_id from table where ind_actief = 'J')
    and ind_uitgesloten is null
    UNION
    SELECT '- Alle districten -', '-1'
    FROM DUAL
    ORDER BY 1
    LOOP
    htp.prn('<option value="' || rec.ID || '">' || rec.NAME
    || '</option>');
    END LOOP;
    htp.prn('</select>');
    END;
    However: L_val is determined by a multiselect list. So, L_id can be: 'A:B:C'. I can convert the value of l_id to 'A','B','C' (with eg replace function). However in a where clause one cannot say: WHERE UPPER(dienstcode) in l_val. So I created a refcursor which I put in a pl/qsl table. Then I looped through the pl/sql table.
    Somehow this did not have the same results. Eventhough the refcursor gave back the same data which I tested by logging the values of the pl/sql table just before the htp.prn command, the htp.prn did not return the values.
    Does anyone know why this happens? Is there a difference between the for loop in this code and looping through a self defined pl/sql table?
    Thanks in advance
    Maurice

    Please, anybody could help me with this?
    Thank you!

Maybe you are looking for