Query on Multi-select Item and STRING_TO_TABLE

Hi everyone - here's the scoop:
I've got a multi-select item on a US state field that returns one or more state ID selected (eg. '15:26:49'). I want to use that to find rows in a table where the state ID is one of those values. State ID is indexed and I want to ensure that the index can be used, so I don't want to be doing "where instr(...)".
I read a post on Ask Tom - http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:110612348061 - where he parses a string of values into a table that can be used in an IN clause, thus allowing use of the index.
Here's my question - I'd like to take advantage of APEX_UTIL.STRING_TO_TABLE to do my parsing, but it returns APEX_APPLICATION_GLOBAL.VC_ARR2. I tried a bunch of different casts but couldn't make it work with a query done as per Tom Kyte's post. Ultimately I wrapped STRING_TO_TABLE and just "copy" the VC_ARR2 to a table of numbers, like this:
create or replace function string_to_numtbl(p_string in varchar2, p_separator in varchar2 default ':')
return num_table as
l_data num_table := num_table();
l_vc_arr2 APEX_APPLICATION_GLOBAL.VC_ARR2;
begin
l_vc_arr2 := APEX_UTIL.STRING_TO_TABLE(p_string, p_separator);
FOR z IN 1..l_vc_arr2.count LOOP
l_data.extend;
l_data(l_data.count) := l_vc_arr2(z);
END LOOP;
return l_data;
end;
So I can use the multi-select to feed an IN clause. I'm still getting familiar with casts, but it seems to me thought that there ought to be a straighter path to allow the return of APEX_UTIL.STRING_TO_TABLE to be used in an IN.
Any thoughts?

VC_ARR2 is an index by table and in the Tom's example he is using a nested table which
has a different structure and allows different operations. To make this short, you will not be
able to use VC_ARR2 in a SQL statement. Yes, it would be good since ApEx has its own
function to convert a string to a table and back. I have no problems using Tom's examle.
Here, you will find some description on differences:
http://www.unix.org.ua/orelly/oracle/prog2/ch19_09.htm
and here, you may want to se the utilization of PL/SQL collections on my demo application:
http://htmldb.oracle.com/pls/otn/f?p=31517:84
http://htmldb.oracle.com/pls/otn/f?p=31517:87
Denes Kubicek

Similar Messages

  • I need a code for Advanced Search based on my custom multi select listbox and query through programatically (jquery)with out design

    Hi,
    I have a grid and advanced search link buttonand
    search button.
    if i click on Advanced Search link...open a panel with 3 list boxes(multi selection)
    if i select multi selected items in list boxes and click on search-->show the grid with selected items
    getting data from Sql server custom database.
    And the code i wil expect  is 'Programatically using jqury and asp.net code' with out single line of design.
    Could you please help on the above task.

    Hi,
    I have a grid and advanced search link buttonand
    search button.
    if i click on Advanced Search link...open a panel with 3 list boxes(multi selection)
    if i select multi selected items in list boxes and click on search-->show the grid with selected items
    getting data from Sql server custom database.
    And the code i wil expect  is 'Programatically using jqury and asp.net code' with out single line of design.
    Could you please help on the above task.

  • Multi-select prompt and variable

    Hello!
    I have a table function (which is my data source) that has a number of input parameters and the problem is with multi-select prompt because it doesn't support setting a value in a variable (OBIEE 10.1.3.4.1.). Can I somehow get a list of selected items from multi-select prompt and pass it as one string (value) to my request variable? Or maybe you have any other idea?
    I've searched old posts but I couldn't find solution to my problem regarding this issue.
    Tnx a lot!

    Hi,
    This post will solve your problem;
    http://www.rittmanmead.com/2009/11/oracle-bi-ee-10-1-3-4-1-multi-select-prompts-string-aggregation/
    Good Luck,
    Daan Bakboord
    httP://obibb.wordpress.com

  • Item availability for selected items and directly create the delivery

    Hi All,
    For a very big sales order ..lets say having 700 line items ...is there any convenient way to create the delivery for selected items ..e.g. 30-40 line items rather going and selecting the line items then doing the item availability.
    do you have any LSMW format by which we can do the item availability for selected items and directly create the delivery.
    kindly Guide me..
    With Regards
    Azeez.Mohd

    Hi ,
    There is no stand way of doing it . You need to take help of abaper to do this :
    1. Create a t code where if you give sale order number , it displays a report with all the items with a check box near to it as we see in SE16 .
    2. This report could be best in ALV form where users can do "ctr+f" and search only the required materials then select those lines and press a button on the top of report .
    3. Once the button is pressed , program will run vL01n ( create delv in backgrnd) in a BDC form . At time of delev creating , the bdc program in backgrnd uses only those items which were selected by user and not the other items .
    4. Program will create a delv using a BDC in background and return the delv number for user to view tht.
    U can also try using FM : RV_DELIVERY_CREATE to create delv in backgrnd after user selection if BDC is getting tricky.
    Hopefully ,this shuld work and will be a easy process for the customers.
    Let us know the outcome .. .
    B O L ..
    Hope this Helps !!!

  • Javascript, IllustratorCS3, select items and change layers

    Hi
    I am trying to select an object defined with fill color Cyan and move that object to another layer. Is there any way to do this with JavaScript? Could you please help.
    PS: I want script to select that object, not the user.
    Thanks
    Sel KAHRAMAN

    Thanks for your reply Yann,
    I already know how to change the texts, the problem is that the texts I would like to change:
    To select old purchase orders or templates, choose
    Then select items and add them to the shopping cart 
    Are not in the list of attributes/texts...
    Where can this text be located?
    I find it hard to believe that it is hardcoded...

  • Query a table using Multi Select Item

    Hi everyone!
    I got a page where I have this multiselect item, and I want to query a table using its values.
    For example: The Multiselect item has this values: 1,2,3,4,5,6,7,8,9 and 10
    And I want to query every person who has ID_CLASS 1,4,7 and 9 by selecting those IDs from the list, and when I click que Consult button the Report displays those persons.
    Whowever I can't accomplish this, I was trying to find a post about this without success.
    Can anybody help me with this?
    Thanks!!

    Hi,
    This is my problem, I select 2 or more options in the multiple select item, then after I click the "Consult" buttom it submits the page, however only 1 option is highlighted. For example I choose the first two options, then I click Consult and the page is submitted. After that only one of the 2 options are selected, but I need to get the 2 options highlighted as selected items.
    If I clear cache I think I'll lost everything. (selected items)
    Thanks again!

  • AF:QUERY : JBO-25058 when we add duplicate instance of multi select enabled and search

    Hi Getting JBO-25058 error when we add duplicate instance of multi select enabled attribute from Add Fields and click on search Our requirement is to add validation if search panel has duplicate instance of multi select enabled attribute but this error comes before control goes to Managed bean. Kinldy help. Typical message: JBO-25058: Definition _sel__vci_lov_LOV_ForecastType_ActiveRevnForecastVC_vcrow2097_ForecastType_vcrow2097_ForecastType_itemHolder_vcrow1_ForecastType of type Attribute is not found in __LOCAL_VIEW_USAGE_sessiondef_ForecastAM_oracle_apps_sales_salesForecasting_forecasts_forecastService_applicationModule_ForecastAM_ForecastOverviewPageVO_vcrow2097_ForecastType_itemHolder_ForecastTypeLookupPVO_findByVC_8fc_LOV_ForecastType__lov__filterlist__vcr___.
    Regards
    Rajesha

    Sarah,
    I could reproduce the error.
    However, I created a drag-and-drop page fragment with quick search and table, and modified the adfc-config-EmpVw task flow to reference the drag and drop page:
    <view id="EmpVwTable">
    <page id="__120">/EmpvwDD.jsff</page>
    </view>
    And then I still get the same error, so this looks like an ADF bug to me.
    I also created a stand-alone jspx page using drag and drop, same error as well. I suggest you make a testcase without JHeadstart and contact Oracle Support.
    Steven Davelaar,
    JHeadstart Team.

  • How can a classic report be filtered using one select item and dynamic action?

    APEX 4.2.1
    DB 11g
    I have a page with 4 reports on it.  The top report is an interactive report and the following 3 are classic reports.  The users would like to be able to use a select list to filter the 3rd report by PO line number without refreshing the entire page.
    After verifying that the report is set to allow partial refreshes, I took the following steps
    1.  Created a PO Line select item (p_po_line_select) in the same report region
    2.  Added p_po_line_select to the report query
    3.  Created a dynamic action on p_po_line_select with 2 true actions
         1.  Set value (p_po_line_select)
         2.  Refresh report region.
    The Set Value dynamic step was not working; I would get an out of memory error at line 2, memory stack error, or the value did not get saved to session state depending on the settings I selected.  I was able to get it working with the following set:
    1.  Action = Set Value
    2.  Set type = PL/SQL Expression
    3.  PL/SQL Expression = :p_field_does_not_exist
    4.   Page items to submit = blank
    5.  Selection Type = Item(s)
    6.  Item(s) = p_field_does_not_exist
    p_field_does_not_exist does not exist as a page or application item which leads me to believe that this is a bug and I am just lucky that it worked.  I would rather know how to do this properly.  Can someone please provide a link to a working example of how this should be done or state which settings are wrong?
    I was able to reproduce the issue in the following app
    http://apex.oracle.com/pls/apex/f?p=4500:1000
    workspace = occam
    user  test/apex1
    Thanks,

    STOP POSTING DUPLICATE THREADS.
    If you have additional information, continue the discussion by posting it as a follow-up on the original thread: What is the proper way to filter classic report using just an LOV select field with dynamic action?

  • Ungroup selected items and delete them

    Hello!
    I have a code that removes the tags (if there are tags) from objects and then deletes them.
    The problem is if tagged objects are grouped. Or even grouped objects in another group.
    I need to ungroup the selected objects and then untagging and deleting them.
    How can i do this?
    My current code:
    for (var iSel = app.activeDocument.selection.length-1; iSel >=0 ; iSel--){
         var currentSelection = app.selection[iSel];
              if (currentSelection.associatedXMLElement != null) {
                   currentSelection.associatedXMLElement.untag();
                   currentSelection.remove();
              else {
                   currentSelection.remove();

    I think we need an extra loop through all pageItems of the selection, checking the tag names.
    You could assemble the length of the found objects tagged with "product". If the length is not 0, use a confirm dialog like that: "You are about to untag and delete [number] of objects tagged "product". Do you really want to do that?" [No] [Yes]. If [No] is clicked, the script will stop.
    "Confirm" is documented here:
    http://jongware.mit.edu/idcsjs5.5/pc_Window (SUI).html#confirm
    For an example in usage look here:
    //Select an object that can get a fill color and run the script snippet:
    var myResult = confirm("Would you like to color your selection with \"Yellow\"?");
    if(myResult === false){
        //Do nothing!
        exit();
    if(myResult === true){
        app.selection[0].fillColor = "Yellow";
    Uwe
    PS. I'll be offline the next few hours…

  • Table View MULTI SELECT option and Event handling problems

    Hello All,
    I am facing problem while giving miltselect option in a table view. When i mention multiselect attribute in Select option in table view, i am unable to select all the rows which i want to select,because i have an event onRowSelection event activated so when i select a row then it will automatically go to the event and i am unable to do multiple select.
    Can you guys pl tell me is there any way thtat i can put check boxes in a table column and by that i can get values of row seelct and can perform my subsequent SQL operation.
    Also i am not able to navigate in table view through BYPAGE or BYLINE option. When I click on navigate button then page got refreshed and i lost data.
    One more query guys , can you pl tell me how can i store my internal table values from one event for the another event. I have used EXport/Import but internal table values get refreshed as page got refreshed on event switching/selection.
    Please respond.

    hye rahul.
      as i told you my second solution, will help you . the values remain in the corresponding UI elements.
    For example , you have a drop down and table view. both will trigger events. bind the data of the table at drop down event and bind the dat of the drop down at table event.
    event = cl_htmlb_manager=>get_event( runtime->server->request ).
    CASE event->id.
    when 'dd1'.                   drop down event is fired.
    bind data for drop down
    dd ?= cl_htmlb_manager=>get_data(
                                          request = runtime->server->request
                                          name    = 'dropdown'
                                          id      = dd_id'           " name of the drop down id
    along with drop down bind data for table view
        tbv ?= cl_htmlb_manager=>get_data(
                                          request = runtime->server->request
                                          name    = 'tableView'
                                          id      = 'tbv_id'           " name of the table view
    when 'tbv_id'.                   drop down event is fired.
    bind data for drop down
    dd ?= cl_htmlb_manager=>get_data(
                                          request = runtime->server->request
                                          name    = 'dropdown'
                                          id      = dd_id'           " name of the drop down id
    along with drop down bind data for table view
        tbv ?= cl_htmlb_manager=>get_data(
                                          request = runtime->server->request
                                          name    = 'tableView'
                                          id      = 'tbv_id'           " name of the table view
    This is how data should be binded in case of Stateless application. All the UI elemets must b binded again.. as the global data is refresed again.
    Hope this helps.
    Regards,
    Imran.

  • Multi Select Item to be passed in URL ( Please help urgent)

    Hi ,
    I have an item P1_PRODUCT('SOAP','PASTE','BRUSH')  in page 1.
    User selects multiple products and submits and a report is displayed .
    I have an hyper link on one of the column and when user clicks this > target is URL
    and i have passed P1_PRODUCT to page2 using the link
    P2_PRODUCT is hidden item.
    javascript:popUp2('f?p=&APP_ID.:2:&APP_SESSION.:P2_PRODUCT:&P1_PRODUCT.',500,500);
    My problem here is no matter what i do P2_PRODUCT is always set to only one value. not able to pass all three at once.
    Please help...

    It is possible to include commas in item values
    2.5 Understanding URL Syntax
    List of item values used to set session state within a URL. Item values cannot include colons, but can contain commas if enclosed with backslashes. To pass a comma in an item value, enclose the characters with backslashes. For example:
    \123,45\
    But it may be that your item value contains colons.
    There could be workarounds for you, depends on what your issue actually is - I'm not convinced is a delimiter issue, rather timing on session state values. Are you able to produce a demo on apex.oracle.com?

  • Selected items and LLA task

    Hi,
    I worked with EC-CS and I will have to configure BCS now. Although both have the slected item configurations to balance FS I didn't find a task like the Task 1110 in ECCS which balances the FS after loaded. Is there such task in BCS ? Where can I create it ?
    Thanks
    Renato

    Hi Renato,
    Or in the reclassification there is fuctionality that does it ?
    - There is no build-in functionality that does it.
    Just to confirm, I have to create a reclassification where the trigger is the sum of I/S accounts ?
    - not only. Please follow this scenario:
    http://help.sap.com/erp2005_ehp_02/helpdata/en/91/4b721354f68b45987210d89e9d30b3/frameset.htm

  • HT1491 How do I pay for a selected item and download to myPC

    I am new to iTunes. I want to purchase a song and play from my PC or Android phone and tablet. I could only find a way to add to my wish list. How do I purchase from my search or the wish list?
    Figured out how to purchase! Duh. Now I need to figure out how to load onto a new Apple device.
    Message was edited by: SandyK713

    Howdy SandyK713,
    This article will show you how to use iTunes to get that music onto your Apple Device.
    iOS: Syncing with iTunes
    http://support.apple.com/kb/ht1386
    Take care,
    Sterling

  • How to use multi select in a query report

    I defined a lov. This lov retuns name and a id. I want to use the result of this multi select in my query.
    I always get invalid number when I choose two items of the select. When I debug I see that the return value of the multi select is 1:2. How can I change the seperator : in , I tried the following but this does't work.
    if :P26_PRODUCTTYPE IS NOT NULL then
    l_sql := l_sql ||' and producttype in
    (REPLACE(:p26_producttype,'':'','','' ))';
    end if;

    as you're finding, multiple values selected from html db multi-select list items (and checkboxes) are stored as a single, colon-delimited string. i explained an easy way to handle this via pl/sql in...
    Multiple select list
    ...that post shows you how to throw the selected values into a pl/sql table and step through them as needed. it also showed how to use an instr to parse through the string if you want to go that route. you could use that same instr logic right in your sql query. so let's say your lov for your multi-select item (P1_MY_MULTISELECT, we'll call it) was defined as...
    select ename, empno from emp order by 1
    ...and your user selected KING, FORD, and JONES. :P1_MY_MULTISELECT would store those values as...
    7839:7902:7566
    ...you could then write a query to return the selected enames with something like...
    select ename, job
    from emp
    where insrt (':'||:P1_MY_MULTISELECT||':',':'||empno||':') != 0
    ...hope this helps,
    raj

  • Multi-select and change only certain words in a text box to different font - possible?

    In Word I can select a number of words in a sentence or paragraph by holding the Shift key (PC, natch!) and then bold all of them at the same time, etc. Can't make this happen in inDesign - am I missing something simple?
    Need to take a list like the one below and bold only the dates, using the bold version of the font I'm using - thereby actually changing fonts.
    June 1  Something
    June 25  Something else
    July 24  Something else entirely
    Thanks for any help you can offer.
    Joan

    Hi,
    John is right.
    However, I advise you to take a look at HighlightGrep, [JS] written by Roland Dreger, with an amazing "Live Mode" option that allows you to see the result of a research (before launching it, of course) while you're building your query … simulating your "selection".
    … and, as john said, may be finish the deal with nested styles !

Maybe you are looking for

  • How to change a report in Manager's Desktop?

    Hi all, i want to change a report in the Manager's Desktop Compensation Management. Report name: Cost Center You can see it under this link: [www.starbulls-fotos.de/1.jpg] When i now run the report i can see the report, but with no selection screen.

  • Report painter problem very urgent

    Hi to ALL, I have prepared two reports of cost centre through report painter. The format is proper is both the reports. The set is also correct and values in set(i.e cost centres) are also properly but when we execute the report one report is being e

  • "recovery disk"delete.how to recover again.

    apple air  Install the dual system (windows and os x 10.7.4) recover disk delete. now  i need update mountain lion .Upgrade is not successful.Suggesting the need recover disk. How to recover "re disk"

  • Remove from .Mac gallery

    My .Mac subscription expired a few weeks ago. Even though I am logged out of .Mac using System Preferences, iMovie still tells me that two previously published movies are published to my nonexistent .Mac Gallery. Anyone know how to let iMovie know th

  • DNG Converter 5.6 crashes

    I just downloaded the DNG Converter 5.6 Release Candidate for Mac.  I have been trying to convert photo files from my Canon EOS 7D and the application crashes every time I try to convert.  I tried converting them right from a Firewire 800 card reader