Not In Query on select List

Apex 4.2
Two Tables
SITES
  Site_id (pk)
  Site_name
  Date
ACTIVATION
   Activation_id (pk)
   Activation_date
   Deactivation_date
   Site_id (fk)
* I have a report based on the ACTIVATION table. Upon clicking an edit link on any row of the report, it takes you to a form to edit the information. The form allows you to edit the Site_id. The Site_id is represented as a select list with the following LOV query:
SELECT SITE_NAME, SITE_ID
FROM SITES
* This select list gives me all of the site_names, however, I want to filter this select list by only showing those sites that are not in the report. All of the site names are as follows:
Maryland
Los Angeles
Natchez
Bakersfield
Austin
The report has rows:
Activation ID     Site Name              Activation Date     Deactivation Date
  1                         Natchez                    3/11/2013         
  2                         Los Angeles               5/27/2020
I would like for the list to only display the ones that are not in the report, i.e. Austin, Bakersfield, Maryland.
I have tried to write a NOT IN query. When I click an edit link from the report to navigate to the form, the select list shows the list of entries that I desire, however, the row that I clicked shows the id of the Site Name instead of the actual name. I'm not sure where my error is. I hope all this makes sense. Thanks for your help in advance. Oh, and my query that I wrote is as follows:
SELECT SITE_NAME, SITE_ID
FROM SITES
WHERE SITE_ID NOT IN (SELECT SITE_ID
FROM ACTIVATION
WHERE this = that)

Hi,
This is because the query is excluding the current site you are trying to modify since it is actually in the report.
You can include in your query:
or site_id = :Pxx_SITE_ID
Where Pxx_SITE_ID is the item holding the site_id value and xx is your page number.
Thank you,
Erick

Similar Messages

  • Impact of selecting "Removing Query from Selection List" in 2 channels.

    HI All ,
    I have customized a query in one channel (My Agreements and Contract Documents query in Master Agreements List channel) and have removed the standard query from the channel by checking the  "Remove Query from Selection List" and introduced my custom query in that query group .
    But  it resulted in break in chain for  "Master Agreements" link in "Contracts To Do List" channel as the link was pointing to standard  "My Agreements and Contract Documents" query and is displaying "The query can not be executed. Contact your system administrator" when ever I click on that.
    Any pointers on how to overcome above scenario wud be gr8!
    Regards,
    Uday

    Hi Uday,
    In order for To Do List channel to work, the query definition should be in the Master Agreement List query group. Do you still want the standard query in the To Do List? If so, you would have to leave it on the Query Group as To Do list is pointing to it. May be change the display name of the query so you can differentiate between the 2 queries. The other option is change the To Do channel to point to the custom query.
    Regards,
    Vikram

  • Query Search Select List

    I have a search form with multiple search list. When the user selects an option from the search list I want my other select list to filter based on the first dropdown option selected.
    Web App name "Listings"
    First Dropdown list is "Animal" - option 1 "Elk", option 2 "Deer", Option 3 "Bear".
    Second Dropdown list is "City" - option 1 "Steamboat", option 2 "Brush", Option 3 "Strasburg".
    From the first dropdown list the user would choose animal. I'm trying to accomplish the second dropdownlist to refresh and only display what City the animal would reside in. Can this be done? How would one do this?

    then v_where_clause := v_where_clause || c_isnull;If the parameter is not supplied then are you sure you want to match to null?
    Why not something like:
    if in_customer_id is not null then
    c_where_clause := c_where_clause||' WHERE customer_id = :customer_id';
    else
      c_where_clause := c_where_clause||' WHERE 1=1 or :customer_id is null';
    end if;
    if in_account_no is not null then
    c_where_clause := c_where_clause||' AND account_no = :account_no'
    else
      c_where_clause := c_where_clause||' AND 1=1 or :account_no is null';
    end if;Then your list of values in the using clause is always constant.
    This does get complicated if your in parameters are used multiple times in different ways throughout the query you are building up.
    Ben

  • Query filter selection list flat file

    I know that when using a "multiple single value" variable a user can paste or upload a text file of values BUT...
    is it possible to use a text file to create a query FILTER value list?
    (I mean in the query designer not at query run-time or in a workbook)
    thanks

    oh i just now see that with BI 7.0 you can right click on the right side of a filter selection and choose "Upload Selection"

  • Tables not in Query Builder table list bug?

    In HTML DB version 1.6.0.00.87 we have tables defined in our schema in our workspace. When we create a view and click on the [Query Builder] link, no tables are in the drop down list for our schema. Why? The schema is there. I can go into the SQL Workshop and query the records our of the tables, but they are not listed in the [Query Builder].
    I tried this same function but with my workspace at htmldb.oracle.com. The tables in my schema are listed there.
    Is this a bug that was fixed in version 1.6.1.00.02?

    There is one schema assigned to the workspace. That schema is listed in the pop-up window. Here are the steps I am doing:
    1.) Click on SQL Workshop
    2.) Click on Create Object
    3.) Click on View
    4.) The correct schema is listed in the Schema field. There is only one schema in the drop-down list for the Schema field.
    5.) Click on [Query Builder]. A separate browser window appears with the correct schema. There is only one value in the drop-down list for the schema. "- Select Table -" is in the TABLE field.
    6.) I click on the TABLE field to get a list of tables for the schema. Only "- Select Table -" is listed. No other tables are listed.
    I can cancel the Create View and return to the main page of the SQL Workshop. I can click on Tables to see what table are available. I select the correct SCHEMA and see the list of tables.
    I tried this in the same version of HTML DB (v 1.6.0.00.87) in a different database ie. a different HTML DB repository and received the same results, missing tables in the pop-up page
    I do not know why the tables do not list in the [Query Builder] for the Create View.

  • In Windows 7 document printing the "Properties" button does not open the print selection list.

    New computer OS is Windows 7. Old computer OS was Windows XP.
    HP Officejet 4500 Wireless Printer G510n-z printed documents as I chose using the Porperties button on the old system. Under the new system the Properties button does nothing and I must print using "general printing" instead of the setting I wish to use. How can it be fixed?

    When something works one day, but not the next, then something has changed. The fonts issue is an easy one, but with no new ones, then it is possible that one, or more, of the installed fonts has become corrupted.
    While fonts are not the only possibility, they ARE a common problem. Titler is very sensitive to fonts, either corrupt ones, or badly written ones, that are not exactly "corrupt."
    Good luck,
    Hunt

  • DYNAMIC LOV FOR SELECT LIST

    hi to all,
    i've a question regarding lov query based select list:
    For a certain user i need that the lov display a list
    if app_user = BACK_OFFICE I NEED THAT ther query on wich is populated the
    select list is qry 1.
    if app_user is another (consultant) i need query 2 for populating the select list
    1) select name|| ' ' || fname D, id K from partner
    2) select name|| ' ' || fname D, id K from partner WHERE UNAME=(:APP_USER)
    Any solutions would be greatly appreciated.
    Another solution would be to have 2 different apps (one for back-office, one for external consultant), but there i should always duplicate all changes to the second one, loosing a lot of time.
    Now thinking as well to use hidden fields.
    If not clear enough please ask me.
    Thanx a lot.
    Message was edited by:
    Marcello Nocito

    I think one solution wold be to create two different named querys, one containing query 1 and the second query 2. Than u must create an Application Item(like a session variable) in wich u will store you condition. If you want to use the app_user variable u allready have it so you don't need to create it any more. On your page where u want to display the different select list u create two items, one with the query 1 as source and a second item(select list) having the source query 2. Then you must add a condition display on both of them like. Item one is displayed when Value of Item in expression 1 equals expression 2. And you pust :APP_USER in expression 1 and BACK_OFFICE in expression 2. And for the other item, that contains query 2, you put the opposite condition Value of item in expression 1 is not equal to expression 2, and expression 1 is :APP_USER and in expression 2 is BACK_OFFICE.
    Hope this helps.
    Florin

  • ORA-20001: Secondary key column identified wwas not located in the select l

    Error in mru internal routine: ORA-20001: Secondary key column identified was not located in the select list of the query
    I am receiving this error when I try and update a record in an updatable report (SQL QUERY Updateable). Two of the values being updated rely on a named LOV.
    The SQL query for the report does pull in both the keys (there are two keys)....I am not certain why this is happening...any clues would be appreciated.
    thanks. Karen

    sorry. I thought I had made it current. It is now.
    I am not certain if you will be able to run it as it is accessing our test tables. Will I need to move those tables to the workspace. I am also checking here to see if anyone has had experience. thankyou for your patience. I really appreciate it.
    karen

  • Select list filter in a tabular form problem

    Hello everyone:
    I need to filter a list in a tabular form, depend on another column value in the same row of the Tabular Form
    Try using the syntax *#COLUMN#* in the query of select list but did not work.
    This is my query
    SELECT   nombre_respuesta, cod_respuesta
      FROM   enc_respuesta
    WHERE   cod_pregunta = #COD_PREGUNTA#There is another way I can refer to the value of a column in the same row?
    regards
    Gerard

    Thank you so much for the quick response saved my life!.
    For future reference let examples of the use of APEX_UTIL.SAVEKEY_VC2 and APEX_UTIL.KEYVAL_VC2
    This is the query of the Tabular Form
    SELECT   den.cod_encuesta,
             den.cod_det_encuesta,
             den.cod_pregunta,
             pre.nombre_pregunta,
             den.respuesta,
             den.observaciones,
             APEX_UTIL.SAVEKEY_VC2(den.cod_pregunta) codpreg
      FROM   enc_det_encuesta den, enc_pregunta pre
    WHERE   den.cod_pregunta = pre.cod_pregunta  
       AND   den.cod_encuesta = :P6_COD_ENCUESTAThis is the query "Select list"
    SELECT   nombre_respuesta, cod_respuesta
      FROM   enc_respuesta
    WHERE   cod_pregunta =  APEX_UTIL.KEYVAL_VC2regards
    Gerard

  • Dynamic select list as APEX plug-in custom attribute?

    I'm developing a region plug-in in APEX 4.0.1. I wanted to make one of the custom attributes a select list where the options offered were the current application list templates (queried from the <tt>apex_application_temp_list</tt> view: the rendered plug-in region should be styled using a standard list template from the current theme). However, the Select List plug-in custom attribute type only appears to support static lists. Can anyone confirm that I've not missed anything and that this is indeed the case?
    If so, it seems that the plug-in will have to rely on developers typing a list template name into a text box, which is far from ideal. (Unless anyone can suggest a workaround?)
    Component specific templates can be applied to several built-in component types&mdash;lists, calendars, reports&mdash;so it would make sense for there to be a similar capability for plug-ins where these are congruent with an existing template type, e.g. by providing a Template Picker plug-in custom attribute type.

    Hi,
    you have not missed anything. Plug-in attributes of type "Select List" just support static values. And I'm not sure if a query based Select List would really help, because what happens if the template is deleted. Or in the reports where it shows if the template is in use.
    So I think your second approach to extend plug-in attributes to link to certain shared components (Lists, Templates) is the better way forward, because that will also allow us to know what you are actually referencing and we can use that information in reports, delete operations, ...
    Will add it to possible enhancements for 4.1
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Select list null value issue - for filtering the tabular form report

    hello,
    I have a tabular form created on emp table and in the table their are entries for the employees who don't have a location, like it is null for some of the employees.
    Now I have created a select list item - for filtering the results based on location.
    my select query for select list item is
    select distinct location_name d,location_id r from emp order by 1
    -- so my select list contains all the distinct location_name including the null on my tabular form.
    so based on the selelcted value(in the select list), I am able to filter the results in my tabular form.
    but the thing is that when i try to select an null value from my select list - i am not able to filter my report - like its displaying all the records, its not filtering.
    can anyone help me out with this.
    thanks.

    Hi
    Try below select for LOV
    select distinct nvl(location_name,'No Location') d,nvl(location_name,'No Location') r from emp order by 1 And then change tabular from select where clause also use nvl(location_name,'No Location') like
    SELECT *
    FROM emp
    WHERE nvl(location_name,'No Location') = :Px_YOUR_ITEMBr, Jari

  • Display all records from 4 select list

    Hi,
    trying to associate 4 select list where i could display all records from a list linked to an other list.
    1./ Created an item for each select list
    P1_employee_name
    P1_departments
    P1_employee_type
    P1_locations
    2./Set both null and default values to '-1' for each item
    3./Associated these items to source columns in the Region:
    where employee_name=:P1_employee_name
    or :P1_employee_name ='-1'
    and departments=:P1_departments
    or :P1_departments ='-1'
    and ......
    When running the report, couldn't display all records from a given list associated to an other list.
    e.g: Display all emp and type of emp for sales dept in Paris.
    Thks for your help

    I believe the issue is that you need to group your predicates such as:
    where (employee_name=:P1_employee_name
    or :P1_employee_name ='-1')
    and
    (departments=:P1_departments
    or :P1_departments ='-1')
    Also, if you are not already using the "select list with submit" type items, these work great for this case as the page will be submitted when the user changes the value of employeenam and the report will then reflect this change.

  • Open qty errin Selection list For Ref Doc. screen while converting to order

    Hi SAP Gurus,
    For one of my materials, the open quantity is not updating in the Selection list For Ref Doc. screen while converting to sales order.
    Can you please help me?
    Thanks,
    Ketan

    Hi Senthilkumar,
    I really appreciate for your kind Hint of SEL ID.
    I created and assigned new 'Sel Priority' to the SEL ID same as for Routing.
    Now while converting Planned order to Production order system is asking for Reference operation set as there is no such need of Routing as I already mentioned in previous post.
    Regards,

  • Making Read Only A select List Item

    Hi,
    I am using Application Express 3.1.1.00.09 version.
    If the date field is future date then the Select List field should become Read only.
    I tried to make "read only".
    When I made it "read only" '>[] is displayed???
    Does some one have a solution?
    Thanks,
    Priyanka.

    Hi Leckraj,
    I assume that
    the select list is not displayed at all.means that your page item is not rendered as a select list input control, but it's rendered as text only, right? That's the nature of the read only condition, it will render almost all controls as text only.
    About the dynamic action solution. That can be simplified and doesn't require a hidden item or JavaScript.
    1) Create a dynamic action which fires for the "Page Load" event
    2) As (Server Side) Condition Type set "exists (SQL quer returns...)" and specify your SQL statement
    3) Use a "Disable" action to disable your select list page item
    The above dynamic action will only be included and executed on the page, if the SQL statement returns a value.
    Note: Please keep in mind that dynamic actions are browser based operations, for a skilled user it's no problem to enable the select list and modify the value. To secure it you should add a server side validation to verify if the user is really allowed to modify the value. That's the difference to the "Read Only Condition", because in that case the APEX engine guarantee that the value can't be modified.
    Regards
    Patrick
    Member of the APEX development team
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Select list display value in javascript function

    Hi All,
    I have a select list in a tabular form having a display value & return value.
    I am using $x(var_name).value or $v(var_name) for retreving return value of the select list in a javascript function.
    Can anyone let me know how can I get the display value of the select list in a javascript function? Im using Apex 3.2
    Thanks & Regards,
    Sandeep

    What if the select list is not an item. Select list I am talking about is in a tabular form.Regardless of how they're generated in APEX, in JavaScript they're all DOM nodes. There are many ways of accessing the node of the required element. Consider the Items for Order... tabular form on page 29 of the Sample Application:
    var productNameLOV = document.wwv_flow.f04[0] // select list containing name of product on first order line
    var productNameLOV = $x("f04_0001") // another way of accessing the same node, using the ID attribute generated by apex_itemWe can see this using the Safari console:
    => productNameLOV = document.wwv_flow.f04[0]
        <select name="f04" id="f04_0001" autocomplete="off">…</select>
    => productNameLOV = $x("f04_0001")
        <select name="f04" id="f04_0001" autocomplete="off">…</select>Once you've got the node&mdash;however you get it&mdash;you then use the methods shown above:
    => i = productNameLOV.selectedIndex
        3
    => productNameLOV.options.text
    "Business Shirt [$50]"
    So it appears you would use:var item = document.wwv_flow.f01[i];
    var selected = item.selectedIndex;
    var selectedOption = item.options[selected].text;
    This is meaningless:...
    var my_var = document.wwv_flow.f01[i].id; // f01 is tabular column of select list
    if ($x(my_var) == 'display_value') //$x(my_var) is having return value, but i need display_value there
    <tt>$x(my_var)</tt> returns a DOM node object, whilst <tt>'display_value'</tt> is a string: they are not comparable.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • Aging report logic

    Hi, There is an requirement where i need to generate report on aging.. ie.. amount unpaid by the customer to be identified on different aging 0-15 days 16-30 days 31-45 days 56-90 days so the output of the report show be like above on different again

  • Error encountered while loading data into an Essbase cube from oracle DB

    Hi All, I am trying to load data into an Essbase cube from Oracle db. Essbase is installed in an 64 bit HP-UX machine and oracle database on HP -UX 11.23 B server. While performing the above I am getting the below error messages: K/INFO - 1021013 - O

  • How to compress (or cleanup) Sqlite database after delete?

    Is there a way to compress (or cleanup) a Sqlite database after a large number of rows have been deleted? For example, if I have a database file around 1Mb and delete all the rows the database file remains at 1Mb (despite being empty). If I then open

  • Swf preload in dreamweaver?

    hi all, i'm creating a website using dreamweaver. and i would like to insert a preload before the main website comes up. can i put a preload made in flash before entering the main website made in dreamweaver? thanks a lot for your help! Cheers, SLLIM

  • Limite d'activation atteinte Adobe Photoshop Elements 10

    Bonjour, J'utilise Elements 10 avec deux no de série, dont un est installé à mon domicile et l'autre à mon travail. Le pc de mon travail a été victime d'un virus. Nous avons dû formater le disque. Finalement, nous avons changé de pc au travail et j'a