How to use the value of the select in SQL queries list

I have a list with the list of states (P1_STATE) in Page 1. When I send the page, I get the VALUE of P1_STATE in Page 2 to the format: DC:AS:AK. I use the application to display the form in the Page 2 below.

Select *.
of STATE_REF
where IN location_id (: P1_STATE)

Now the format of P1_STATE will not work in the query. So it's not fetch all results. Is there a way in which the values of the selection list can be used in SQL queries. Thanks for the help.

Hello

Try something like:

select *
from STATE_REF
where ':' || :P1_STATE || ':' LIKE '%:' || LOCATION_ID || ':%'

Andy

Tags: Database

Similar Questions

  • How to use the selection tool to resize a text box? Before I was able to click on the text box with the selection too in order to resize, but now I click on it and it only gives me 'path' or 'anchor' options.

    How to use the selection tool to resize a text box? Before I was able to click on the text box with the selection too in order to resize, but now I click on it and it only gives me 'path' or 'anchor' options.

    Ashley,

    What about window > show the rectangle enclosing (Ctrl / Cmd + Shift + B to toggle)?

  • In version 5, how to use the selection tool to move items?

    I can use the selection tool to select objects, but when I try to drag, nothing happens. My solution is to use the selection tool to select an object, then use the transform tool to drag the object in its new position. Any help is greatly appreciated.

    Start by restoring your InDesign preferences. Tutorial here:

    http://PFL.com/TRB

  • How to use the select statement in loop for

    Hi all

    My question is can I use a select statement in for loop like as follows.

    for the key in the selection of one_table key.

    When I use this am getting an error as found select invalid I ID

    How to select a statement use in loop for

    Please suggest me.

    Thank you
    Sree

    Hello

    You can use code below

    For key in (select button from table_a)
    loop
    If key.key = 1 then
    -insert statement
    on the other
    -Select statement
    end loop;

    Thank you
    Naveen.

  • How to change the selected index of a list of a DG?

    It is probably simple and I'm in the right place. I have a datagrid. When I select an element of the DG, he fills out a form that can be updated. One of the form fields is a list control with a remote object values. I want this list to highlight/select the value that corresponds to that of the DG when the item is selected. For example if I have a list of numbers 1, 2, 3, 4, 5 and the question that I select in the DG contains a 4, then I want the list to automatically select 4 as a default in the list when I select the element of the DG.

    You must loop through the result of your RemoteObject looking for a match, after that you have added to the list. I posted a sort of model of example to show what I mean, yours will be different of course, but I think you can grasp the concept based on what I'm trying to show.

  • using the function - how to use the values of the input variables on the table select statement names

    Hello community, I have a problem when creating a function. The purpose of this function is to check the table of weather gave yesterday or not. We must check this on different tables on different sachems. We are creating a function with input variables.

    CREATE OR REPLACE FUNCTION IN_SCHEMA.IS_YDAYDATA_TO_TABLE

    (

    in_schema IN VARCHAR2,

    in_tablename IN VARCHAR2,

    in_datefield IN VARCHAR2,

    )

    RETURNS INTEGER

    AS

    -Declaring variables

    v_is_true INTEGER.

    BEGIN

    SELECT

    CASE

    WHEN MAX (in_datefield) = TRUNC(SYSDATE-1)

    THEN 1

    ON THE OTHER

    0

    END

    IN

    v_is_true

    Of

    in_schema.in_tablename

    ;

    RETURN v_is_true;

    END;

    /

    When creating, I got error: [error] ORA-00942 (44:19): PL/SQL: ORA-00942: table or view does not exist

    How to use the values of the input variables on the table select statement names?

    Hello

    Here's a way you can use dynamic SQL statements for this task:

    CREATE OR REPLACE FUNCTION IS_YDAYDATA_TO_TABLE

    (

    in_schema IN VARCHAR2,

    in_tablename IN VARCHAR2,

    in_datefield IN VARCHAR2,

    in_first_date DATE DEFAULT SYSDATE - 1,.

    in_last_date DATE by DEFAULT NULL

    )

    RETURNS INTEGER

    AS

    -IS_YDAYDATA_TO_TABLE returns 1 if in_schema.in_tablename.in_datefield

    -contains all the dates in the in_first_date of the range through included in_last_date

    - and it returns 0 if there is no such lines.

    -If in_last_date is omitted, the search only the data on in_first_date.

    -If in_first_date is omitted, it defaults to yesterday.

    -Time parts of the in_first_date and in_last_date are ignored.

    -Declaring variables

    sql_txt VARCHAR2 (1000);

    v_is_true INTEGER.

    BEGIN

    sql_txt: = 'SELECT COUNT (*).

    || 'FROM ' | in_schema | '.' || in_tablename

    || 'WHERE ' | in_datefield | ' > =: d1'

    || «AND» | in_datefield | '< >

    || 'AND ROWNUM = 1';

    dbms_output.put_line (sql_txt |) '= sql_txt in IS_YDAYDATA_TO_TABLE");  -For debugging

    Sql_txt EXECUTE IMMEDIATE

    IN v_is_true

    With the HELP of TRUNC (in_first_date) - d1

    TRUNC (NVL (in_last_date

    in_first_date

    )

    ) + 1                -- d2

    ;

    RETURN v_is_true;

    END is_ydaydata_to_table;

    /

    DISPLAY ERRORS

    If you must use dynamic SQL statements, put all the SQL statement in a single string variable, such as sql_txt in the example above.  In this way, you can easily see exactly what will be executed.  Comment out the call to dbms_output under test is completed.

    Try to write functions that will address not only the question that you have now, but similar questions that you may have in the future.  For example, now that interest you only to the verification of the data of yesterday, but later, you might want to check another day or range of days.  The above function combines the convenience of a function simple (looks like yesterday data if you don't tell him otherwise) with the power of a more complex function (you can use the same function to check any day or range of days).

  • How to use the Type of Oracle Table values in the Select statement.

    Hello

    I get the initial set of values in the Table of Type Records of the Oracle and want to use the list of values in the Select statement.

    For example, try something like the following:

    TYPE t_record () IS RENDERING
    ID TABLEA.ID%type,
    NO TABLEA.NO%type

    );
    v_record t_record;
    T_table TYPE IS the v_record TABLE % TYPE;
    v_table t_table;

    -Code to fill the values of v_table here.

    SELECT ID, NO, COLLECT in BULK IN < some other table variabes here > FROM TABLEA
    WHERE ID IN (i) v_table USER.USER;

    I want to know how to use the Type of Oracle Table values in the Select statement.

    Something like this:

    create or replace type t_record as  object (
    id number,
    no number
    )
    /
    
    CREATE or replace type t_table AS TABLE OF t_record;
    /
    
    set serveroutput on
    declare
    
      v_table t_table := t_table();
      v_t1 t_table := t_table();
    
    begin
    
      v_table.extend(1);
      v_table(1).ID := 1;
      v_table(1).No := 10;
    
      v_table.extend(1);
      v_table(2).ID := 2;
      v_table(2).ID := 20;
    
      SELEC t_record (ID,NO) BULK COLLECT INTO v_t1
      from TableA
      FROM TABLEA
      WHERE ID IN (select t.ID from table(v_Table) t);
    
      for i in 1..v_t1.count loop
        dbms_output.put_line(v_t1(i).ID);
        dbms_output.put_line(v_t1(i).No);
      end loop;
    end;
    /
    

    No test!

    P;

    Published by: bluefrog on March 5, 2010 17:08

  • How to retrieve the selected values of the selectOrderShuttle using ADF 11 g

    Hello world

    Did anyone has idea how to retrieve the selected items by using the shuttle and the order of the elements by using the 'SelectOrderShuttle '?

    Thank you

    valuechangeevent of the shuttle would fire when you shuttle points back.

        public void selectOrderShuttle1_valueChangeListener(ValueChangeEvent valueChangeEvent) {
    
            ArrayList list = new ArrayList(Arrays.asList(valueChangeEvent.getNewValue()));
    
            if (list != null){
                for (int i=0; i
    
  • Shuttles: How get/use the value of worth shuttle highlighted?

    Hello

    I use traditional apex 4.0.2.00.07 on IE8 with blue theme. I have browsed the forum but couldn't find an answer to the following question:

    I use a standard part of shuttle in one of my forms. I know how to read the 'selected' on the right side values and how to read the "deselected" on the left side. But what I want to do is of taken later, 'stressed' (i.e. once clicked at, but not yet passed to one of the sides) value to use for example in dynamic action.

    What I want to achieve in the end:
    Sometimes, you end up with many very similar and easy to confuse the entries in a shuttle service. I would like to give a user of the information on the last, once you click on in highlight shuttle value before it actually (de) selects. It should not matter if the value is always off (left) or already selected (on the right).
    Clicking once on a value of shuttle, I for example fill elements only display on the same page with additional information for the selection. But to get back them, I need the return value from the folder highlighted.

    A simple example:
    Tables A and B have USER.USER, .NAME and. DESCRIPTION columns each. There can be many-to-many relationships between A and B that are stored in table A2B (includes just two columns FK A_ID and B_ID).

    On my P1 page I want to hold a new record to table A, plus the relationship with existing records in B. I have a shuttle service with source

    "Select B_ID from A2B where A_ID =: P1_AID" combined with a list of values with B.NAME as display and B.ID as return value. I want to view b. information in another article on the page whenever the shuttle in a new value 'B.NAME' is highlighted.

    Any ideas?

    ARO
    Martin

    Hi Martin

    I think it will work in Internet Explorer. Change the run when the Page loads for:

    $("#P44_SHUTTLE_LEFT,#P44_SHUTTLE_RIGHT").click(function(){
    f_emp_detail($('option:selected').val());
    });
    

    Here's a demo

    http://Apex.Oracle.com/pls/Apex/f?p=579:46

    Basically, rather than bind the option element's onclick event, it binds to the list of all Shuttle, then looks up the selected item.

    Note that if you have other lists of selection on the same page, you will need to do the more selective $('option:selected'). for example $(' #itemid option: sélectionné ')

    See you soon

    Shunt

  • DVT:pivotFilterBar - how to get the selected values of the filter

    Hi all

    I have a question: how to get the selected values from the pivot table filter bar programmatically?

    I tried to use
    pivotTable.getDataModel().getDataAccess().getValueQDR(startRow, startCol, DataAccess.QDR_WITH_PAGE);
    but to the edge of the side DATA INCORRECTESdeclarations page, it seems that it will return the cached values.

    Environment: JDev 11.1.1.3.0 without tasks.

    Thank you
    Miroslaw

    Hello

    You can retrieve the value selected in the PivotFilterBar through the PivotFilterBar model, instead of dataaccess:

    Download the template of the bar pivot filter instance
    QueryDescriptior queryDescriptor = (QueryDescriptor) pivotFilterBar.getValue ();

    retrieve a list of criterion, each of them is used to fill each lov in the pivot filter bar
    ConjunctionCriterion conjunctionCriterion = queryDescriptor.getConjunctionCriterion ();
    List criterionList = conjunctionCriterion.getCriterionList ();
    for (int i = 0; i)<_criterionList.size(); i++)="">
    AttributeCriterion = (AttributeCriterion) criterionList.get (i) criterion.

    _selected is the currently selected value
    Selected object = criterion.getValues () .get (0);

    System.out.println (_selected);
    }

    Hope that helps,
    Chadwick

  • kindly tell how to use the unique value of a table with the index 0

    kindly tell how to use the unique value of a table with the index 0

    Hi
     
    Yep, use Index Array as Gerd says. Also, using the context help ( + h) and looking through the array palette will help you get an understanding of what each VI does.
     
    This is fundamental LabVIEW stuff, perhaps you'd be better spending some time going through the basics.
     
    -CC
  • inadvertently, click "always use the selected program to open this type of file" how undefault and redo icon to the icon of white empty file?

    I accidentally click "always use the selected program to open this type of file" on the srt file. How to make it undefault and again the icon to icon file empty white?

    You can do this via a registry change, but it is more appropriate for a typical user to simply use the system restore:

    System restore

    Ever wished that you can go back in time following a bad fall? With Windows, you can.

    Installation sometimes a driver or a program can make Windows run slowly or erratically. System Restore can return programs and system files from your PC to a time where everything worked, potentially prevent hours of troubleshooting of headaches. This will not affect your documents, images or other data.

    In Windows 7, you can create system restore points more and see exactly what files will be deleted or added when your PC is restored. For more information, see create a restore point.

    For more protection, use the restore system backup and restore, which is designed to help save email, photos, documents and other personal files.

    To use the system restore

    Before you start the system restore, save open files and close all programs. System Restore will restart your PC.

    1. Open system restore by clicking the start . In the search box, type restore the system and then, in the list of results, click on system restore.  If you are prompted for an administrator password or a confirmation, type the password or provide confirmation.
    2. Follow the steps in the wizard to select a restore point and restore your computer.

      For more information, see System Restore: frequently asked questions.

    In Windows 7 system restore can prevent headaches hours after an accident.

  • How to pass parameter in the function using the select statement?

    Hello

    I had a problem. I can't pass as parameter to the function by using the select statement. But it can pass as a parameter using the "code". How can I solve this problem?

    For example,.
    Select * from table (SplitFunction ('HS750020, HS750021')) < < < this work.

    but

    Select * from table (SplitFunction (select LOT_NO in the TRACER_SEARCH_SCHEDULE where JOB_ID = '36')) < < < do not work.

    Thank you for trying to help him. Thank you.

    Select * from table (SplitFunction (select LOT_NO in the TRACER_SEARCH_SCHEDULE where JOB_ID = '36'))< do="" not="">

    Try like this

    select * from table(select splitfunction(lot_no) from tracer_search_schedule where job_id='36')
    

    Just make sure that your subquery returns only 1 row.

  • Y at - it a paper on how to use the map data the lookup value?

    I'm looking for a documentation where I could find information about the game of card data and how to use the map data configured according to look.

    Any help is very appreciated.

    I found a few threads on data cards:

    http://topliners.Eloqua.com/docs/doc-2434

    http://topliners.Eloqua.com/docs/doc-2817

    http://topliners.Eloqua.com/message/14058#14058

    Maybe that can help you get started

  • Box "Always use the selected program to open this kind of file" is grayed out out__cant change file association for any type of file

    I'm not allowed to change any combination of files for any type of file... If I try to associate a file type with a program that I can't the box is grayed out to always open the file with this program, for example, if I try to open .py (programming in python language file) with python from another program whenever I have to right click and open with python, but if I want to choose the "always use". the selected program to open this type of file"is grayed on I can not change it... pls help

    Hi VikkHckrz,

    1. you remember to make changes to the computer recently?

    Method 1:

    You can consult the following KB article and run the fix it tool available and check if you can assign file association.

    When you run an .exe on a Windows Vista-based or Windows 7 computer file, the file may start another program

    http://support.Microsoft.com/kb/950505

    Also check out the link:

    http://Windows.Microsoft.com/en-us/Windows7/change-which-programs-Windows-uses-by-default

    After running the fixit so check the option is grayed out or not.

    Method 2:

    If you're still having problems, then you can try to change the settings in the registry only if it is present on your computer and check if it helps.

    a. Click Start, type regedit in the search box and press ENTER.

    b. navigate to the

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer

    (c) in the right side of the screen, double click on "NoFileAssociate".

    d. change the value of "NoFileAssociate" from 1 to 0.

    e. exit the registry editor and restart the computer and check.

    Important: The above mentioned steps show you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs.

    For more information about how to back up and restore the registry, follow the steps from the link below:

    http://Windows.Microsoft.com/en-us/Windows7/back-up-the-registry

    Hope this information is useful.

    Jeremy K
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think

    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

Maybe you are looking for