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

Similar Messages

  • 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

  • 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

  • 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

  • Select query based LOV for tabular form attributes

    Hi HTMLDB Team,
    Congrats u all for the new release of HTMLDB in htmldb.oracle.com.
    I badly need a solution of the below problem.
    Say , i have table called user_col_comments now i want to display the table_name ,column_name and comments in a tabular form.I displayed only one row for the tabular form.Now i create a select query based LOV for attribute table_name where i got all table_name in drop down list.
    Point is that after selecting any data from drop down table list i want to get the corresponding fields to be populated in column_name attributes.How can i wrote the select query based LOV for the attibute column_name.
    I wrote it as 'select column_name d,column_name r from user_col_comments where table_name=:TABLE_NAME Its not working?
    Similarly i want same thing to display for comments after matching both table_name and column_name.
    Any solution to get rid of those problem will be highly appreciable...
    If u need my htmldb.oracle.com userid and password to solve the problem i will sure let u email it.
    Cheers,
    Eman

    hi rchalton,
    can u plz little bit more clearer .I know hopefully u can imagine the problem and may u guide me thru proper way.....One think i understand that there must be multiple process and submit but "only when..." that u have said i cant understand that part........
    U are welcome to give me proper solution.....
    Thanks for the reply ....atleast one can pay hid to me.....
    Cheers,
    Eman

  • Chart based on Select list with submit Lov problem

    Hi,
    I have one page with interactive report showing username with links, date and
    database actions.
    Another page contains one region having flash chart based on select list with submit Lov.
    The lov is created by dynamic query.
    Every time when i click the 1st page report link, the 2nd page lov is populating the value automatically. But the problem is chart displays NO DATA FOUND message though the LOV has many values.
    I don't want to display any null values so set to NO for LOV
    I tried to write Before header computation (PL/SQL Function Body) to set the lov value, but the query is displayed as such.
    I don't want to assign any static default value also as the values are dynamic for every link.
    The following is my Before header computation of Select list with submit (Item name is p11_schema). (PLSQL Function Body)
    begin
    if :p11_schema is null then
    return 'select distinct owner schema1, owner schema2 from auditing
    where access_date=' || :p11_access_date
    || ' and username=' || :p11_username
    || ' order by owner';
    end if;
    end;
    This is my chart query.
    select null link, obj_name label, sum(sel_count) "Select", sum(ins_count) "Insert", sum(upd_count) "Update", sum(del_count) "Delete" from auditing
    where username=:p11_username
    and access_date=:p11_access_date
    and owner=NVL(:p11_schema, OWNER)
    group by owner, obj_name
    Example: If there more than one records in the lov, the graph should display the 1st record. When i select another record, the chart accordingly display the selected values. But inially it should not display "NO DATA FOUND" message.
    I tried using all the combinations of computation type for the lov, SQL query ( I could not use if conditon then), PLSQL expression, PLSQL function body. But it does not work out.
    Can anyone please help me out.
    Thanks.

    Hi Scott,
    Thanks for your reply.
    I found out the solution for this problem as below.
    But i did it in different way to tackle the dynamic query wich returns more than one record using rownum always the 1st record when it is empty instead of assigning constant (static) value like '1'. And i am returning LOV itself for both null or not null condition as below.
    Declare
    q varchar2(4000);
    begin
    if :p11_schema is null then
    q:='select distinct owner schema from auditing';
    q:=q || ' where username=:p11_username ';
    q:=q || ' and access_date=:p11_access_date ';
    q:=q || ' and rownum<2 order by owner';
    Execute immediate q into :p11_schema USING :p11_username, :p11_access_date;
    end if;
    return :P11_SCHEMA;
    end;
    Thanks.

  • Dynamically changing the select list in an LOV based on the login user

    We have a field in a form which is a combobox.The form is to be linked to different profiles of users.Based on the logged in user we would like to restrict the select list in the LOV.ie user1 should see a LOV which is different from that seen by user2.Is this possible.If so how can this be done?Kindly reply.
    Thanks & Regds,
    Jayanthi

    Thanks for ur reply.But my problem is that i have a table having details of some products which includes spareparts also(Name,id,price etc).In my form i have the combobox field which should have a list of these products which the user can select.Now depending on the user's profile he should see only his related products(One profile of users should view only the products but not the spares while the other should view only spares.)The details of both the products and spares are in the same table.we have a criteria to differentiate between the products and the spares.The LOV should display at run time, either products or spares depending on his profile as he logs in. Hope u understood my problem.
    Regds,
    Jayanthi
    Hello Jayanthi,
    I had a similar situation in my last project.
    While you can solve this by modifying your query, this will always come around as may be later some other criteria to restrict based on User/His Role/Something else. Hence I fixed it at design level itself. Though I can't give my situation I can tell you the solution applying my logic.
    Altering your Product Table and adding one more database Column say Product_Category and updating the table with Product Category =1 for Products and 2 for Spares. You can extend this further for other types.
    Create a new Table say User_Groups that will have
    Group_id
    Group_Name
    User_Id columns and will contain all the User ids inserted groupwise.
    Create one last Table Group_Product_Map
    That will have
    Group_id
    Category_id
    This will store each Group_Id followed by Category_id of Products to which these group members will have access to.
    Now write a database function getCategory( p_User) which will query User_Groups table to get Group_Id
    and further query Group_Product_Map Table based on group_id to get Category_Id.
    This function will return category_id.
    Huh!
    So your LOV will have a query as select *(or whatever) from Product where category_id = getCategory(portal30.wwctx_api.get_user)
    Hope this helps
    Madhav

  • Problem with query based LOV

    Hi,
    Maybe someone could help me with the following. I think it is a shortcoming of HTMLDB, but I'm not sure.
    I've got a Select List item, P10_PERSON, which resides in a tabular form. The Select List is based on a query, say:
    select name   display_value
    ,      id     return_value
    from   personAs is should be, P10_PERSON shows only the names.
    When my action is an insert or modification, the results will be writen in the table PERSON_MEETING.
    Now I want to make sure that the same person coulden't be selected a second time for the same meeting. So I alter the query based LOV with the following:
    select name   display_value
    ,      id     return_value
    from   person
    where  id not in (select person_id
                      from   person_meeting
                      where  meeting_id = :P10_MEETING_ID)This sounds correct and works in Designer, but not in HTMLDB. The NAME isen't shown anymore, instead the ID is shown in the page.
    Is this because the person doesen't actually exists anymore in the LOV after it has been saved (stored in PERSON_MEETING)? If so, does anyone knows a work-around?
    Thx!
    Message was edited by:
    F. Klein
    (removed typing error)

    I've got 3 tables. PERSON, MEETING and PERSON_MEETING.
    They have the following structure:
    # PERSON            #
    # ID   NUMBER       #
    # NAME VARCHAR2(50) #
    # MEETING                   #
    # ID          NUMBER        #
    # DESCRIPTION VARCHAR2(100) #
    # PERSON_MEETING    #
    # ID         NUMBER #
    # PERSON_ID  NUMBER #
    # MEETING_ID NUMBER #
    #####################In PERSON there are 3 records, in MEETING there is only 1.
    PERSON:
    ID     NAME
    1      KEVIN
    2      BILL
    3      JOHN
    MEETING
    ID     DESCRIPTION
    1      DEVELOPERS MEETINGNow I want to link the persons to a meeting in the PERSON_MEETING table.
    The column MEETING_ID will be filled automatically through a variable or parameter (I don't know the exact term).
    I defined the PERSON_ID column as an query based select list with the query:
    select name   display_value
    ,      id     return_value
    from   personThis works perfectely, the select list (or lov) shows KEVIN, BILL and JOHN. When I select BILL and save my adjustment, the following record will be shown in PERSON_MEETING
    PERSON_MEETING
    ID     PERSON_ID     MEETING_ID
    1      2             1Now that I inserted BILL as a participant for the Developers meeting he should be removed from the select list. Only KEVIN and JOHN should be in the list. Therefore I change the query of the select list into:
    select name   display_value
    ,      id     return_value
    from   person
    where  id not in (select person_id
                      from   person_meeting
                      where  meeting_id = :MEETING_ID):MEETING_ID is the item in the page containing the ID of the meeting.
    When I make this adjustment, the select list only contains KEVIN and JOHN (as it should), but the first record shown on the page (record with BILL) doesen't show BILL anymore, instead his ID will be shown (2)...

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

  • Problems with customizing select lists and popup LOVs

    Hi
    I have 2 problems about select lists and popup LOVs.
    The first one is about a select list in a tabular form.
    It should be created with APEX_ITEM.SELECT_LIST_FROM_LOV or similar and take its values from a named LOV.
    This worked fine but now it should also have the possibility to enter a free value.
    I tried to accomplish that by creating a APEX_ITEM.POPUP_FROM_LOV, but there is a problem with the function that is called by the arrow icon right to the input field (for eg. genList_f11_5()).
    If the row is added by addRow, then it works fine, but if the row is is not empty
    then the function call is like genList_f11_$_row() and the input field gets no value, when a LOV option is selected.
    The other problem is about a select list which should have the possibility to enter a custom value and
    also there should be the possibility to select several values. I tried to implement this by a text area containing the selected values and a multiple select list, with an event handler in each option. The user could click options and they would be copied to the text area. The problem is that I couldn't make the event handler work in IE.
    I would appreciate any ideas about either of these problems.
    Tiina

    Hi,
    If you download application you can see source.
    I have not write any instructions, sorry.
    If you are on Apex 4 you can just load jQuery UI autocomplete library and take ideas from my app.
    If you download my sample in zip there is uncompressed htmldbQuery library.
    You can see that and take only function htmldbAutocomplete.
    Then check jQuery UI document
    http://jqueryui.com/demos/autocomplete/#method-search
    There is method search that you can use open list just by click of input.
    I hope this helps at start.
    Regards,
    Jari

  • One select list with multiple LOV's (LOV based on how page was called)

    APEX 4.0.2
    I've a DML form page from a report on which I need a single select list item to have a differing LOV based on how the form page was called.
    The calling page (report), contains an edit link column and a create button. Depending on which is selected, I wish the LOV for my select list item to change. The idea behind this is that if someone creates a new entry, I want to constrain the select list to a subset of rows of a table query populating the LOV. On the other hand, if an existing item is edited, I want the select list LOV containing all rows of a table query populating the LOV.
    What I've tried...
    - Duplicates of select list item each triggered to render based on an arbitrary value set when either "create" or "edit" are selected. This did not work because the item was part of DML and would not allow replication on the same page.
    - Logic in the LOV sql statement controlling which sql was to be run based on an arbitrary value set when either "create" or "edit" are selected. This did not work as logic is not allowed in LOV sql statements.
    Any thoughts? Many Thanks!
    Paul

    Hello Patrick!
    Thanks for responding - Love your captcha plugin!
    Anyway, these are the two dynamic LOV's. The first I have in play right now (when creating new records). I need to have the other for existing record modifications.
    LOV #1
    select stock_no d, stock_no r
    from   [email protected]
    where  status like '%Awaiting Transfer%'
    or     status like '%On Hold%'
    order by 1LOV #2
    select stock_no d, stock_no r
    from   [email protected]
    order by 1As I mentioned, I attempted to use plsql logic in the query to trigger one or the other based on a value set when the user either clicked an edit link or a create button but couldn't get the dynamic LOV to commit with that extra code in it.
    Thanks!
    Paul

  • Select list and subquery: "LOV query is invalid"

    Hi all,
    I want to create a select list with the following format:
    "name1 (count of another table)"
    "name2 (count of another table)"
    I've boiled it down to a simple query with a non-correlated subquery that works fine in SQL*Plus but not as an LOV:
    select table1.field1 || (select count(*) from table2) d,
    table1.field2 r
    from table1
    I get this (Apex 3.2.1):
    1 error has occurred
    * LOV query is invalid, a display and a return value are needed, the column names need to be different. If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query.
    Even this doesn't work:
    select table1.field1 || (select 'a' from dual) d,
    table1.field2 r
    from table1
    I've tried it with an inline view, joining table1 to a select from table2 that returns the count, but I get the same result. Any ideas?
    Edited by: MalcA on Jan 22, 2010 12:14 PM

    I don't know, but the difference is that the count(*) code goes from the select clause to the from clause.
    Other times I had the same problem and always did it and it was the solution.

  • Select List (Parent/Child) LOV

    I have the Easy Oracle HTML-DB book, they give an example of a
    Parent Child Select List using a query.
    Does anyone know how to apply the Parent/Child relationship with
    a List of Value generated from a table.
    Example
    Parent Child
    Car Pontiac
    Car Buick
    Car Cadillac
    Car Nissan
    Truck Tahoe
    Truck Silverado
    Truck F150
    Truck Titan
    The parent(s) in the above example are Car/Truck, the children are in the adjacent column.
    Objective: When the parent "Car" is chosen, only the "Pontiac/Buick/Cadillac/Nissan" will be available, once the child is selected,
    wish to submit to a empty table that can grow dynamically.
    OS: Windows: XP
    Oracle ver.: 10g
    Apex ver.: Release 2

    Hi,
    are you just having one table storing all the values?
    1) Create a "Select list with Submit"
    2) Lov query would be something like
    SELECT DISTINCT
           CAR_TYPE AS D
         , CAR_TYPE AS R
      FROM WHATEVER_TABLEThe distinct is only because you have mixed your parent and child values in one table instead of having two separate tables with a FK from the child to the parent.
    3) Create another "Select List"
    4) Lov query would be something like
    SELECT CAR AS D
         , CAR AS R
      FROM WHATEVER_TABLE
    WHERE CAR_TYPE = :P2_CAR_TYPE-> in the where clause you restricting the second lov with the value the user has selected in the first select list.
    The first "Select List with Submit" will trigger a full page refresh when you select a car type. If you want to avoid that you can use the AJAX based "Cascading Lov" feature of my ApexLib Framework (see http://apex.oracle.com/pls/otn/f?p=33231:4 ) or search on the forum for "cascading lov ajax" for other similar solutions.
    Patrick
    My APEX Blog: http://inside-apex.blogspot.com
    The ApexLib Framework: http://apexlib.sourceforge.net
    The APEX Builder Plugin: http://sourceforge.net/projects/apexplugin/

Maybe you are looking for

  • Cisco ASA 5505 and Airport Extreme

    We have an office that uses an Airport Extreme as part of the network. The Airport Extreme uses a Cisco ASA 5505 as its gateway. The Cisco provides site to site VPN capabilities with other remote offices. We just got this configuration partially work

  • Problem in parsing xml file via JWS

    We are using custom java api to send xml request to our xmlserver. This does request/response in xml. When I run the application in standalone environment it works fine. But after using JWS, HttpResponse object is skipping some bytes (specifically co

  • Array problem, why aren't the object references being stored?

    Hi, I have a ClassRoom class, in its constructor I instantiate an array: public class ClassRoom {     public Teacher teacher;     public Student[] studentList; public ClassRoom() {         teacher = null;         studentList[0] = new Student();      

  • Music via MIDI ... anyone?

    I've created a number of MIDI projects in Java. These are fun music education games that kids really like to play. I want to rewrite them in Flash or Flex (obviously because Java's Swing interface is pretty bland, and because Flash, Flex and ActionSc

  • PowerPivot for SharePoint 2013 Configuration not starting

    Dear, I have Windows 2008 R2 SP1 (up to date version) SQL Server 2012 SP1  PowerPivot For SharePoint (11.1.3000.0 -> the number is from the control Panel) But I try to run the command PowerPivot for SharePoint 2013 Configuration, the wizard is not st