Select List Query Restriction

Hello,
Hopefully this is a quick one.
I'm trying to restrict the results of a query in a report by using a select list with a named dynamic LOV. Basically the report will only display rows that are the same as the value currently in the select list. My problem is that I'm trying to have an 'All' value in the select list that will result in all rows being displayed.
I have tried using a LIKE in the query and setting the LOV to display null, then setting the null return value to %%%. This works exactly how i want it to if I hard code it into the query. However, when I try to use it as a value in the select list no rows are returned. The variable in the URL looks fine however it's not translating properly.
Has anyone got any suggestions or alternate ways of doing the same thing?
Cheers.

Yes that has fixed the problem, either way % or %%% wasn't working.
However adding the ||'%' to the end of the select list variable in the query appears to have fixed the problem. I don't understand why though, it should have worked with the null return value of %...
Thanks a lot.

Similar Messages

  • Select List (query based LOV) in a wizard created report form

    I have created an updatable report form with 3 columns:
    app_id
    user_id
    group_id
    Each app_id has multiple group_id's associated with it, and I want to show the group_id field as a Select List (query based LOV) that contains the groups associated with the app_id.
    My query for the select list needs to be similar to the following:
    SELECT DISPLAY_NAME, GROUP_ID
    FROM APPLICATION_GROUPS
    WHERE APP_ID = ?????
    ORDER BY 1
    The problem is, I don't know how to reference the app_id from the main report to replace the ?????.
    In other words, if my report returns 2 rows of data like this:
    app_id----------user_id----------group_id
    1-----------------24------------------3
    2-----------------24------------------15
    Then how do I get the group_id column to be a select list of possible groups for each application? If app_id 1 has 3 groups associated with it, 3, 4, & 5 and app_id 2 has 2 groups associated with it, 15 & 16, then those each of the select lists should be based on the app_id.
    Hopefully I explained this clearly.
    Thanks,
    Kris

    Leo,
    Thanks for the response, but I don't think you quite understand my problem. If I go to the Column Attributes screen for the group_id field, I have the "Display As" drop down set to "Select List (query based LOV)", not "Select List (named LOV)". This requires that the sql query be written in the "List of values definition" text area below. Within that text area I have the following query:
    SELECT DISPLAY_NAME, GROUP_ID
    FROM APPLICATION_GROUPS
    WHERE APP_ID = ?????
    ORDER BY 1
    The APP_ID that I need to reference is for the current row of data that is being processed. Therefore, I can't use a :PNNN_APP_ID variable, because that field does not exist on the page.
    Hopefully this explains it a little better.
    Thanks,
    Kris

  • OnChanger="get_ajax_select_xml(this);" with  select list (query named LOV)

    Hello,
    i used Vikas'example Re: cascading lov for tabular form
    i have a problem with Select list (query based LOV)
    when run tabular form i have the following error:
    report error:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    the number of rows of the Lov are 900
    the display variable is 70 char
    is there any limit?
    Thank in advance
    Costanti

    Leo,
    Thanks for the response, but I don't think you quite understand my problem. If I go to the Column Attributes screen for the group_id field, I have the "Display As" drop down set to "Select List (query based LOV)", not "Select List (named LOV)". This requires that the sql query be written in the "List of values definition" text area below. Within that text area I have the following query:
    SELECT DISPLAY_NAME, GROUP_ID
    FROM APPLICATION_GROUPS
    WHERE APP_ID = ?????
    ORDER BY 1
    The APP_ID that I need to reference is for the current row of data that is being processed. Therefore, I can't use a :PNNN_APP_ID variable, because that field does not exist on the page.
    Hopefully this explains it a little better.
    Thanks,
    Kris

  • Character string buffer too small (select list query based LOV)

    Hi,
    Using the select list query based LOV with a select witch is too big, you get this error.
    report error:
    ORA-20001: Error fetching column value: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    When using the Popup LOV query based LOV) then it works nice.
    Can that be solved somehow?
    With the Popup LOV the return value is displayed in stead of the description.

    Hi Andy,
    How do I incorporate your suggestion on a report ?
    Example : I have
    select apex_item.display_and_save(1,column1,5) col1,
    apex_item.display_and_save(2,column2,5) col2 ,
    apex_item.popup_from_query(3, emp_name, 'select user_name, name  empname from table2) col3
    Table 2 is a long list , and I'm getting string buffer too small due to this.
    Your suggestion with HTP is good but I'm not sure how to implement it for reports as I'll like the user to change the values with the select_list.
    I'm not using forms as they want mulit-record on the same page.
    Hope to hear back from you soon.
    Thanks very much.

  • Tabular form (select list Query based LOV)

    Hi all,
    I have this situation:
    a tabular form with two "select list (query based LOV)" fields.
    The first one must affect elements in the second one. And so the second query based LOV field should has a "where attr1 = first_list_selected_value" in the query.
    Is this possible ? Could you show me some advices ?
    thanks in advance.

    OK, thank you.
    But maybe I wasn't too clear.
    I need cascading LOV for each row of my tabular form.
    I have a EMP tabular form
    select
    "ROWID",
    "EMPNO",
    "ENAME",
    "JOB",
    "MGR",
    "HIREDATE",
    "SAL",
    "COMM",
    "DEPTNO"
    from "#OWNER#"."EMP" I need a Select List for DEPTNO for each record of table. After set a value, the second "Select List" for ENAME should be affected automatically.

  • Select List (query based LOV) in V. 4.1.1.00.23

    Hi guys,
    I am having some problems with an APEX application that I have exported from V. 4.1.0.00.32 and imported on V. 4.1.1.00.23.
    I have a Tabular Form region where I have a column which is Display As "Select List (Query based LOV)".
    If I add a new row - choose a new value (not the same as any of the above rows) and "Apply Changes"/"Submit" the value in the new row changes to the value of the 1. row of the tabular form :-( I can update this new row and then it saves the right value... It looks like it is only when inserting a new row.
    Is this a bug or is it a feature ;-)
    Hope you can help...
    /Rene

    Leo,
    Thanks for the response, but I don't think you quite understand my problem. If I go to the Column Attributes screen for the group_id field, I have the "Display As" drop down set to "Select List (query based LOV)", not "Select List (named LOV)". This requires that the sql query be written in the "List of values definition" text area below. Within that text area I have the following query:
    SELECT DISPLAY_NAME, GROUP_ID
    FROM APPLICATION_GROUPS
    WHERE APP_ID = ?????
    ORDER BY 1
    The APP_ID that I need to reference is for the current row of data that is being processed. Therefore, I can't use a :PNNN_APP_ID variable, because that field does not exist on the page.
    Hopefully this explains it a little better.
    Thanks,
    Kris

  • Cascading select list (query based) in a tabular form

    Hi,
    In my application i have two select list in a tabular form one for selecting manager_id and other for selecting employees for the selected manager_id how can i do it in apex 4.0
    thanks in advance

    Ok i will assume that you have 2 select list items called (P1_MANAGER AND P1_EMPLOYEE)
    In employee select list u need to find Cascading LOV Parent Item(s) and set it to P1_MANAGER. Ofc your sql query must be smth like this:
    SELECT employee_name d, employee_id r FROM employee_table WHERE employee_manager = :P1_MANAGER

  • Is is possible to avoid hard-coding the Item in a shared Select List Query?

    I created a "Select List" in the Shared Components area as follows:
    My goal is to create a shared select list that can be used on any form for a particular Field.
    IF :P10_FK_RSTA_CODE is NULL THEN
    RETURN
              'select col_description, col_code_pk
              from CODE_TABLE
              where col_active_ind = ''Y''';
    ELSE
    RETURN
              'select col_description, col_code_pk
              from CODE_TABLE
              where col_code_pk = :P10_FK_RSTA_CODE';
    END IF
    Which works great, but how can I make the select list work for the same column on a different form?
    Because :P10_FK_RSTA_CODE is hard-coded in the function, I can't reuse this Function from a different form.
    (I could rename the Field on every form to the same name, but I'm hoping there is a better way.)
    Is there a way I can pass in a variable from the Field Item to make this dynamic where I can use it on any form?
    Also, I am very new at this, so if there is a better way to do this, I would greatly appreciate any input.
    Thanks in advance.
    MF

    >
    Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and update your profile with a real handle instead of "956902".
    When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
    With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
    I created a "Select List" in the Shared Components area as follows:
    My goal is to create a shared select list that can be used on any form for a particular Field.
    IF :P10_FK_RSTA_CODE is NULL THEN
    RETURN
              'select col_description, col_code_pk
              from CODE_TABLE
              where col_active_ind = ''Y''';
    ELSE
    RETURN
              'select col_description, col_code_pk
              from CODE_TABLE
              where col_code_pk = :P10_FK_RSTA_CODE';
    END IF
    Which works great, but how can I make the select list work for the same column on a different form?
    Because :P10_FK_RSTA_CODE is hard-coded in the function, I can't reuse this Function from a different form.
    (I could rename the Field on every form to the same name, but I'm hoping there is a better way.)
    Is there a way I can pass in a variable from the Field Item to make this dynamic where I can use it on any form?Reference the value of an application item rather than a page item in the LOV query, setting the value using a process or computation on each form page.

  • Unable to create a dynamic action ALERT to be generated on a Select List when particular value is selected.

    Hi everyone, this should be so easy, yet I am stuck.
    I have a form region with an item P110_VESSEL_ID.   This item is a select list.   It is based on the query: 
    select distinct v.vessel_name, v.vessel_id
    from vessels vessels v, frequent_fishermen ff
    where ff.dea_permit_id = :G_PERMIT_ID and
    ff:vessel_id = v.vessel_id
    UNION
    select v.vessel_name, v.vessel_id
    from apex_collections a, vessels v
    where collection_name = 'SUPVES_COLLECTION' and
    a.c002 = v.vessel_id
    If the user decides against the values in the select list query, they may opt to SELECT ALL VALUES.  This SELECT ALL VALUES is a POST ELEMENT TEXT on P110_VESSEL_ID.
    <a id="popVessels" href="#"><font color=blue>Select from ALL Vessels</a>
    This all works fine.
    The issue is that when the user selects a vessel name = 'UNKNOWN' and it's corresponding vessel_id value, I would like an ALERT to appear indicating that they should double check that the vessel is UNKNOWN and not that the is no vessel. 
    I created a dynamic action
    event= change
    select type = item
    item = P110_VESSEL_ID
    True ACtion #1 is the ALERT.
    I currently have no other logic, but cannot even get this to work.  Any thoughts.   I have also tried the SELECT TYPE = jQuery Selector = select[name='P110_VESSEL_ID'] but that does not work either (though I am not certain if the value should be P110_VESSEL_ID or the static name of VESSEL_ID).
    Any help is appreciated.
    ps.  the page is not submitted when the vessel is changed.  There is other data that needs to be entered both in this region and others and many validations run when submit, so the submit would not be an option.
    thanks again,
    Karen

    KarenH,
    KarenH wrote:
    I created a dynamic action
    event= change
    select type = item
    item = P110_VESSEL_ID
    True ACtion #1 is the ALERT.
    This should work.  Sometimes I've see where there is other javascript on the page that may have some errors and is causing the dynamic action code to not be executed.  Use your favorite browser script console to try and determine if this may be the case.
    --Jeff
    P.S. Your jQuery selector can be: select#P110_VESSEL_ID

  • Using a Select list with Submit

    I am trying to use the select list with Submit on my page.
    I have 3 select lists.
    On the first one,I am showing the list of all jacks.
    When the user selects a jack from the first list, I want to show all the jacks except the one which was selected.
    When the user selects a jack from the second list, I want to show all the jacks except the ones selected in the first list and the second list.
    I have created the select lists with submit and then I have put the query for getting the jacks. I created an unconditional branch. I am also passing the variables so that I can set the values of the items on submit.
    I also created a computation as mentioned in one of the OTN discussions, and have mentioned the value of second list to be calculated from the first and 3rd from first and second.
    But after clicking the first select list, I am losing all the existing values on the first page. I wonder what I am missing here. Can anyone hellp?
    Thanks,
    Gargi

    Gargi,
    In this case using 'select list with redirect' makes more sense rather than with SUBMIT. So change all the select lists to 'select list with redirect' (it redirects to same page inserting 'select list' value session state).
    Now for the 2nd select list query add a condition in where clause like
    WHERE sl_col != :P1_SL1And for the 3rd select list query add a condition in where clause like
    WHERE sl_col NOT IN (:P1_SL1, :P1_SL2)Hope it helps :-)
    Cheers,
    Hari

  • Select lists and deactivated values

    Consider the following simplified test case.
    1. create tables like this
    create table lov_values
      lov_pk number primary key
    , name varchar2(10)
    , active varchar2(1) not null
    insert into lov_values valeus ( 1, 'A', 'Y' );
    insert into lov_values valeus ( 2, 'B', 'Y' );
    insert into lov_values valeus ( 3, 'C', 'Y' );
    commit;
    create table trx
      trx_pk number not null primary key
    , lov_fk number not null foreign key references lov_values
    ) ;2. Create an APEX Insert/Update form on the trx table. Define the LOV_FK item as a select list with this query
    List of values definition:
      select name d, lov_pk r
      from   lov_values
      where  active = 'Y' ;
    Display Extra Values: Yes3. Users use the APEX form to create records like this:
      trx( trx_pk, lov_fk ) = ( 10, 1 )   -- users sees LOV_FK value as "A"
      trx( trx_pk, lov_fk ) = ( 20, 2 )   -- users sees LOV_FK value as "B"
      trx( trx_pk, lov_fk ) = ( 30, 3 )   -- users sees LOV_FK value as "C"4. A year later an admin deactivates lov_value 2/B by setting active to 'N'.
    5. When a user queries trx row 10 they still see "A".
    6. When a user queries trx row 20 they now see "2".
    7. When a user queries trx row 30 they still see "C".
    In step 6 I'd like the user to see "B" whenever they query old data with that value but I never want them to be able to create new trx rows with 2/B or update the LOV_FK value of existing rows to be 2/B. I'd also like to avoid using a pick list with a popup window just for selecting from a list of two (could be a few) values.
    Just wondering how others have dealt with this scenario in their APEX apps.

    I actually just found a simpler way in Select list filter in a tabular form problem forum thread. In the query that defines the tabular form I added a column called HIDDEN_FK_VALUE as follows.
    select
    "TRX_PK",
    "TRX_PK" TRX_PK_DISPLAY,
    "LOV_FK",
    APEX_UTIL.SAVEKEY_NUM("LOV_FK") hidden_fk_value
    from "#OWNER#"."TRX"Then I modified the the Select List query to look like this.
    SELECT name d, lov_pk r
    FROM lov_values
    WHERE (active = 'Y' OR lov_pk = APEX_UTIL.KEYVAL_NUM )Works like a charm. Thanks everyone for your input.

  • APEX 4.01 Tabular form with select list error

    When i create a tabular form and i add a select list(query based LOV) the form is not displayed but gives me the next error
    report error:
    ORA-20001: Error fetching column value: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    somebody have an idea what is happening here
    is this still a bug in APEX 4.01?
    hope to have an answer soon.
    Hugo Perfors

    Hi Jari,
    It returns about 1100 records which i think is not much.
    But even when i narrow the amount of records the problem is not solved.
    it this a bug?
    Best
    Hugo

  • How to Fix Select list with redirect Problem

    Hi
    I have a field F1 of type select list with redirect.
    It has an LOV with 2 values USA and Canada for eg..
    I choose USA and hit save and saved it to DB..
    now f1 is stored in table with my User ID and value is USA.
    when I log in next into this page,
    this field should show me the value USA.
    But its not happeneing for me..it always gives the null value when i re login
    is there a way to default/source it to my value??
    I am using
    select f1 from table
    where user_id=:user_id;
    i checked and this query works in sql plus...

    Earl, please see the response in italics for each of your questions below:
    You do want your default value to be one of the values in the select list. Otherwise why would you want the value there at all?
    So, then should I have a default value at all? And, if yes, then what should it be?
    And can't you just set the default value to the first value in your select list, whatever that is, so the first value is the selected value?
    I did that and it works, only if the first value in the select list is always going to be there.  The select list is based on a column data in a table.  And if the data for that column changes then the values in the select list will change.  And, the first value might not always be the same.
    I guess I'm not clear why this isn't doing what you want, besides the fact that
    you seemed to have removed the default value from the dynamic select list query, which you shouldn't do.
    I removed the first value (it could have been any values) from the select list to mimic the "dynamic" select list -- just to test.  The select list data is based on a table and the data in the table can change.
    Thanks
    DP

  • Autofill cascading select lists

    Hello,
    Can anyone please help me out with implementing an autofill cascading select lists. If anyone has implemented a sample example ; can you please provide me the link.
    thanks,
    orton

    Which version of Apex you r using?
    If its 3.2 you can refer to this link: http://htmldb.oracle.com/pls/otn/f?p=31517:119:2521957760329919:::RP,::
    if its 4.0 then enter the name of parent item in "Cascading LOV Parent Item(s)" property of the select list
    and use the parent Item name in the where clause of select list query, like this.
    Select name d, eid r from emp where emp_id in(select emp_id from dept_emp where dept_id = :p01_1);
    where employee select list is the child and the department is the parent select list.
    Thanks
    Tauceef

  • Select list with Title Tag

    Hi,
    I have a form where one of the field is a Select list ( query based LOV )
    STATIC2:Test 1;1,Test 2;2,Test 3;3
    The list that is returned on my page look like this in HTML
    <select ... >
    <option value=""></option>
    <option value="1" >Test 1</option>
    <option value="2" >Test 2</option>
    <option value="3" >Test 3</option>
    </select>
    I would like ApEx to add a title field on the list so the returned value on the page would be like
    <select ... >
    <option value=""></option>
    <option title="Help 1" value="1" >Test 1</option>
    <option title="Help 2" value="2" >Test 2</option>
    <option title="Help 3" value="3" >Test 3</option>
    </select>
    I have tried many ways to achieve this but it seems apex does not give us the possibility to add attributes directly to the option of the list.
    The "Element Attribute" field is only for the whole select list,
    Is there a way to do this ?
    Thanks in advance
    Sebastien

    i managed to find a workaround
    STATIC2:Test 1;1,Test 2;2,Test 3;3
    every option build it this way
    <option value="1" >Test 1</option>
    so changing the value of the LOV like this
    STATIC2:Test 1;1 || '" title="Help 1'
    will make my option in html print like
    <option value="1" title="Help 1" >Test 1</option>
    It's far from nice but it's doing what i needed :)

Maybe you are looking for

  • Have had the descending shadow on my iMac and been told to restart but not sure why, any clues would be helpful thanks

    Had a warning siren tonight on iMac, restarted, seemed ok until a shadowy curtain crept down my screen and I was told to restart again, and again. No clue as to why this has happened, any help would be gratefully received.

  • Best way to JOIN 3 tables into internal table ?

    Hi friends, i have the following issue: i need to join information of 3 different tables ( BUT000, BUT020 and ADRC ) concerning Business Partners and i need them into one internal table. how would this be achieved with best performance ? regards, CL

  • MM and CRM

    Would a SAP MM consultant with basic fuctionality knowledge of the MM module be best suited to work on a CRM prototype? Are there any links/commonalities between the two?

  • Extension Manager update failing.

    I have tried several times to update Extension Manager CC but every time I do it starts downloading then comes up as Update failed. All others apps are updating fine. Mac OSX 10.9.3 Creative Cloud 1.7.0.413

  • Add item detail field into items overview table on ME2xN transactions

    Hi all and happy new year ! We want to add an item detail field (manufacturer part number = MEPO1321-MFRPN) into items overview table on ME21N, ME22N and ME23N transactions. Does someone know if it's possible with a badi or other kind of exit ? thank