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

Tags: Database

Similar Questions

  • How to use the Multiple selection in ADF faces

    I have, I want to know how to use a multiple selection (ADF select several choices) for updating the database.

    by mentioning your exact jdev version.

    As far as I know he in not possible automatic update select a choice that she returns a list which you must map back to the lines of the table yourself.

    Timo

  • The value of another field using the multiple-selection list

    Hello

    I have a multi select list as USER name name...
    In these cases, I select several users as For example JOHN AND JACK
    Database that should get both their email ID then fill in textarea (separated by commas)

    As I am new to apex, pls help.

    Welcome to this forum... :))

    What is your version of the database?

    If you use database 11g then you can use the following query for your condition,

    select LISTAGG(user_email, ':') WITHIN GROUP (ORDER BY user_email) from table_name
    where INSTR(':'||NVL(:PX_USERNAME,user_name)||':',':'||user_name||':')>0
    

    instead of PX_USERNAME use the name of your multi selection list.

    Use this query in your textfield.

    Thank you
    Lacombe

  • Facing problem in the multiple selection list...

    Hi Andy,.

    We are facing a problem more...

    In the selection of the Menu... Like u given a solution for dropdownlist hide which works very well... but the same logic does not work for the multiple selection list item. Why so...


    David...

    Published by: David on November 17, 2008 05:22

    Hello

    If you have added in the Page template, then the P39_BATES_DESCRIPTION will not work. As the P63_ATTRIBUTE_CLASS_CODE is not on the page, javascript will throw an error and that will stop the rest of the code to run.

    You can get javascript to test for the existence of a question of fact:

    if ($x('P63_ATTRIBUTE_CLASS_CODE')) {$x('P63_ATTRIBUTE_CLASS_CODE').style.display = 'none';}
    if ($x('P63_ATTRIBUTE_TYPE')) {$x('P63_ATTRIBUTE_TYPE').style.display = 'none';}
    if ($x('P39_BATES_DESCRIPTION')) {$x('P39_BATES_DESCRIPTION').style.display = 'none';}
    

    Andy

  • 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.

  • 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

  • By the way Select list value to another page via report link

    Hello

    I have a page 1001 with an item from the selection list (SLI), a button (BTN) and a report (EPR).

    After selecting a value of the element of selection it s possible to click on the button.

    After clicking the report button will display the data. Report structure: ID, COL1, COL2, COL3, COD values in COL1 is the links to the page 1011.

    I managed to pass the value of a column in the report, but how to pass the value of SLI this link?

    I tried: SLI, SLI, #SLI # and & SLI... but nothing has worked.

    You have an idea?

    1013248 wrote:

    Please update your forum profile with a real handle instead of '1013248 '.

    I have a page 1001 with an item from the selection list (SLI), a button (BTN) and a report (EPR).

    After selecting a value of the element of selection it s possible to click on the button.

    After clicking the report button will display the data. Report structure: ID, COL1, COL2, COL3, COD values in COL1 is the links to the page 1011.

    I managed to pass the value of a column in the report, but how to pass the value of SLI this link?

    I tried: SLI, SLI, #SLI # and & SLI... but nothing has worked.

    You have an idea?

    Use the exact static text substitution method to reference the value of the element. This requires an end point ('.) ») :

    &SLI.
    
  • problem in the multiple selection list

    Hello...

    That's my problem... We have a few values in session selection multiple list... these values are highlighted in the list... If wen I try to hide the list im unable to do? I think that its because of the session... wat shal I do nw?

    function hidelist()
    {
    document.getElementById('item_name').style.display = 'none ';
    }

    function showlist()
    {
    document.getElementById('item_name').style.display = 'block ';
    }





    David

    Hi David,

    It is difficult to know what can happen that I can't see your page - this error message indicates that javascript can not see the page element to which you are referring to.

    For example, if I make document.getElementById("ABC").style.display, but the article did a 'BCD' ID I would get this error.

    So, the first thing to check is that the list item is the ID that you think it does. Load the page and do a view Source. Find the selection list and check to see how ID attribute there. If it contains the right ID attribute, then it might be easier if you could save the page view Source and send it to me at... so I can watch it.

    Andy

  • How to use the drop-down list box to fill in a text box

    I'm a beginner when it comes to Java Script.  I have seen a lot of different discussions, look at a lot of articles "helping" Acrobat 9 and Java Script, but only to be left confused and dazed.  I hope someone can tell me how to write a script that fills a text box that sits on my form with the value of exports of the selection in the combo box...

    Thank you

    If you want that the read-only text box, simply set with the following custom calculate script:

    Set this field to the value of the drop-down list box

    Event.Value = getField("combo1").value;

    but replace "combo1' with the actual name of the combo box field.

    If you want something else, post again with more information.

  • How to use the Combobox selection to check one of the six boxes?

    I have a combobox with 6 choices ["' (0), RED (1), ORANGE (2), YELLOW (3), GREEN (4), BLUE (5)" "] and I want to place controls in one of the six boxes.

    The comboboxes are all named fnfCB-box, and each of the six have an export value of 0-5, match the choices I can make from the drop-down list.

    If a choice is made in the drop-down list box, the correct checkbox must be checked. If no choice is made in the combobox, no boxes must be selected.

    What are my next steps? Most of the tips seem to work the other way (click on checkbox, update list dropdown value)...

    You can use a custom script to strike for the drop-down list box:

    // Custom Keystroke script for combo box
    if (!event.willCommit) {
        getField("fnfCB-box").value = event.changeEx;
    }
    

    Select the 'value selected to validate immediately' option to the drop-down list box.

  • How to use the saved selections

    I'm trying to figure out how to actually responsive / use a saved selection set. I see the rocking of the eye, but don't understand how to say, reactivate the saved selection for use with respect to editing in view quick mask, for example.

    Thank you

    Selection > load selection.

  • Creation of Validation for the multiple selection list or shuttle point

    Hello
    I'm new to APEX and have questions about the best way to validate the selected shuttle items to verify that they exist in the sys.dba_roles table before submitting. The shuttle point uses a static LOV. I would like to than the error message to display when there is no such thing as a role selected in the element of the shuttle in the sys.dba_roles table.

    Using version 3.2 of APEX
    DB version 9.2.0.8.0
    Internet Explorer version 6

    I tried to create a validation step level about to shuttle P3_ROLE using SQL EXISTS when you press the button SUBMIT. I know that when argued that the shuttle point returns the selected values in a single string delimited by a colon. I use the APEX_UTIL. STRING_TO_TABLE to convert values selected in a table.

    CODE HERE
    declare
    l_selected APEX_APPLICATION_GLOBAL. VC_ARR2;
    number of l_num;
    Start
    l_selected: = APEX_UTIL. STRING_TO_TABLE(:P3_ROLE);
    BECAUSE me IN 1.l_selected. COUNTY
    LOOP
    Select 1 from l_num of sys.dba_roles where role = l_selected (i);
    END LOOP;
    end;

    This is the error ORA-00928: lack of SELECT keyword
    1006 - ERR error in the validation routine.

    Any advice? Thoughts? Thank you.

    Published by: Violet on Oct 14, 2010 14:50

    Hello

    Your code is PL/SQL block. You cannot use this type of validation with your code.

    Try to change the body type of the function that returns the error text and
    code for this one

    DECLARE
      l_selected APEX_APPLICATION_GLOBAL.VC_ARR2;
      l_num NUMBER;
    BEGIN
      l_selected := APEX_UTIL.STRING_TO_TABLE(:P3_ROLE);
      FOR iIN 1..l_selected.COUNT
      LOOP
        SELECT count(1) INTO l_num FROM sys.dba_roles WHERE role = l_selected(i);
        IF l_num = 0 THEN
          RETURN 'Role not exists';
        END IF;
      END LOOP;
      RETURN NULL;
    END;
    

    Kind regards
    Jari

  • How to use the direct Selection tool to select a letter?

    The27thletter.pngI am trying to select the q when I try he selects the text box not the q it's me I'm using InDesgin CC on windows pro 8.1.

    You can make to the creation of each letter on its own chassis (as in your example) and convert it to text outlines. Then with the scissors tool to cut the part you don't need and position it as needed.

  • Limit of characters in multiple-selection list

    Hi people,

    Throw this out there to see if anyone has had this problem, and how they may have gotten around him.

    It seems that the Multi Select lists have a limit of 1000 characters, i.e. If you select so many items in the list and its over 1000 characters, you cannot save the file.

    I would like to say that ok we will have to just a few lists rather than a big workaround, but the customer fixed the list up in this way, and now that we create the hypersite to allow them to select items in this list, it's possible they could try on the hypersite select all. Clearly, it seems that we will have to have validation on the website to ensure that they do not select more than 1000 characters of a value of items in the list, but it would be useful if there was a way Eloqua to enable this.

    The one you have any ideas/advice?

    Something is very appreciated.

    Thank you

    Andrew Mc.

    I think the challenge is that the multiple-selection list is already built and already used in other functions.

    Andrew - you're right that to resolve this problem, you would have to update the list in Eloqua (again, just the option values, not the option names) and also the list in SFDC - you are on right track here.

    I hope this helps!

  • How to download the columns selected in obiee

    Hi all

    Available in obiee which allows to download the selected columns of a report to an excel download all feature.

    Regarding
    Prads

    .. And if you don't, you go to the Page Options > change the dashboard, click on the properties of the report, and select report links...

    Oh, and anyway, you can download "selected columns"; you will need to download the entire report. If you insist on a report that includes only some of the columns, you can build column selectors where the user can select the columns they want to see in the report, and then when they select the "Download" link, the report will only have the columns...

    Visit this link:

    Re: How to add new columns by using the multiple selection

    Edited by: David_T on June 25, 2010 10:19

Maybe you are looking for

  • How can I get the tabs work? Nothing opens in a new tab.

    I can't use new tabs. I use the right click and "Open in New Tab" and the tab is there but focus does not switch on it. I can right-click on the tab and "Open in New Window" but not a new tab. If I close the first tab, left, opens the tab blurred, un

  • Cannot update iOS 9.2.1 on the air of the iPad 2

    Update iOS 9.2.1 for UN-athorised fix comes out. Working victory over 6s but fail after downloading and during treatment on Air2 iPad download using iTunes. Everything an els having this problem?

  • transistor for my diode-transistor vi equation

    This is a diode and transistor vi. You can change transistor/diode under the graph. in the block diagram of the diode you will see that it uses an equation for the current. I put an equation and create the schema for the transistor also so I can see

  • Hello Service

    I am trying to install iTunes and I have a popup that says: "Hello" (morning Service) Service Service was able to start. Make sure you have sufficient privileges to start system services. I'm the administrator on the computer, so I don't see why I sh

  • Office toolbar or Ribbon

    I put the new hard drive in a dell with vista studio. How can I put the toolbar back across the top of the desktop? I thought it was called a Ribbon?