Execute query based on LOV

Hi,
Is there a special code to execute query based on selecting one of the options by the user in the LOV???? or it is as simple as the following???
Set_Block_Property('PAYMENT_VOUCHER',Default_Where,'payment_method=:PAYMENT_VOUCHER.payment_method'); >>>> in the search button trigger(WBP):::
Execute_Query;
Note that the payment method field has a LOV...

Tasneem wrote:
ok..
I tried to set this thread as answered but cannot!!!! believe me...None of answer you get as Helpful or Correct. ???
You should read...Before posting on this forum please read

Similar Messages

  • Executing query based on parameter.

    Hi, iam new to Oracle Reports and need some help on handling multiple queries.
    I have 2 queries A,B where A is a subset of B ( B has some extra columns to be included in the select and where clause).
    Now i need to execute A and B according to a parameter value which i select using a list box.
    For example there are two values open and close in the list box.
    If i select open, query A should execute and if i select close, B should execute and report be diaplayed accodingly...Please let me know how this should be done.
    Thanx

    In the data model you can not have a variable number of columns based on the parameter selection. You need to bring the maximum number of columns in the data model, and then show or hide certain columns in the layout model using format triggers based on the parameters.

  • Execute Query by using LOV (List Item)

    Hello Everyone,
    I did research on how to use List Item with Query but i am still confused since i am a new to the FORM.
    I have created a form where user enters
    Start Date: -- this field user can just type the date
    End Date: -- this field user can just type the date
    Violence: -- this is my List Item (Drop down Menu) where user select the code
    once they select the parameter i have created "Execute" button and it will give number of violence within the date range. the query is giving me right number or violence but then i need to drill down to details.
    so i created a trigger when user double click on the number ( result number) it will pop up another window and display the details
    For example:f_name, l_name, ssn etc...
    Now, my problem is when i double click on (Text Item) it. Its not giving me the number of records that i have get when i execute at the first by using date range and violance code.
    This is the step that i have use:
    when user click Execute button the PL/SQL code:
    Query_step1(:start_date,:end_date,:violations);
    when user double click on Text Item once they have the number this is what i have used code for PL/SQL
    begin
         go_block('xxhc_hearings_rpt_v');
         set_block_property('xxhc_hearings_rpt_v',default_where,'hearing_result = '||'''TERMINATE'''||'and violation '||''||:violations||''||'and propose_term_dt between '||''''||:start_date||''''||' and '||''''||:end_date||'''');
         execute_query;
    end;
    So please anyone can give me little direction that will be a great help.
    Thank You.
    Keyun

    Use the system variable LAST_QUERY to check that you SQL is valid. Assign it to a temp field in the block and check it out.

  • BEx query based on virtual cube donu00B4t display a valid List of Value (LOV)

    Hello
    I have a problem with an invalid LOV. The scenario is the following; There´s a BEx query based on a virtual cube. The query has an exit variable on caracteristic that is based on 0CALMONTH.
    At Universe Designer I simply create a connection, a universe based on this query and export.
    At Web Intelligence (also at Live Office), when I try to execute de query, the prompt to fill my exit variable display a list of value that doesn´t match with the values of the caracteristic at the cube.
    Actually, the list at the prompt starts with 01.0000 and finishes with 05.0968.
    In Universe Designer, the option to edit the list of values is not available. But I think that editing the LOV is not the correct way.
    I´ve tried creating a new query based on the DSO that is the source of the virtual cube. In this case, I had a valid list. Unfortunately, I can´t use this DSO.
    Did anyone already have this problem?

    Hi James,
    can you explain what you mean with "input length for that filed" ?
    The field in the table is varchar2(120). I coudn't found options for the List of value.
    Thanks for your response
    Carsten
    null

  • Include Button that executes PL/SQL procedure to SQL query based region

    I would like to add two columns to a SQL query region.
    These columns would not be sourced from the query, but rather would be used to execute a PL/SQL procedure.
    For example, I would like to have a manager approve or deny adding an additional employee to the department.
    There would be one button for APPROVE. And, one button for DENY.
    The PL/SQL procedure would execute to perform the required DML based upon the selected action (either APPROVE or DENY).
    A sample output would look like this:
    <APPROVE>, <DENY>, John Doe, Accountant
    <APPROVE>, <DENY>, Jane Doe, Accountant
    Is there any way to add a button to a SQL Query based report region where that button executes a stored proc? If so, what is the basic process for doing this?
    Thanks!
    -Reid

    Is there any way to add a button to a SQL Query based report region where that button executes a stored proc? If so, what is the basic process for doing this?Conditional page item? You can associate processes with buttons on a page

  • 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

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

  • Select List (based on LOV) query problem

    Hello experts! I have a small problem here, which I can't seem to overcome.
    I have a page item (select list based on LOV), which is based on a query. The query returns all potential employees of a department that are responsible for a certain duty. So far so good!
    The problem is that there are two departments, which should not only see there own employees but also the name of the employee that has carried out a certain task. However, due to my query, the name of that person is not displayed - only the pk is returned.
    Do you have a recommendation how I display all employees of a specific department and have additional values translated as well?
    My query is as follows: select str_bearbeiter, cnt_bearbeiter from vt_tbl_bearbeiter where cnt_bearbeiter in (SELECT
    CNT_REGIERUNGSBEZIRK FROM TBL_REGIERUNGSBEZIRK) union select str_bearbeiter, cnt_bearbeiter from vt_tbl_bearbeiter where int_behoerde in (SELECT
    CNT_REGIERUNGSBEZIRK FROM TBL_REGIERUNGSBEZIRK where STR_REGIERUNGSBEZIRK = lower (:app_user)) whereas :app_user holds the information of the department.
    Any hint is appreciated!
    Many thanks,
    Seb

    Okay, I just had the right idea and it's working well! Sorry for posting!
    I return the name of the employee that has edited a dataset and simply add all others of the logged on department! Really easy! Should have thought of that before posting! ;-(
    The correct code is select str_bearbeiter, cnt_bearbeiter from vt_tbl_bearbeiter a, vt_tbl_punktdaten b where a.cnt_bearbeiter = b.int_bearbeiter and
    inv_pt_id_sub = :P4_PTIDS
    union select str_bearbeiter, cnt_bearbeiter from vt_tbl_bearbeiter where int_behoerde in (SELECT
    CNT_REGIERUNGSBEZIRK FROM TBL_REGIERUNGSBEZIRK where STR_REGIERUNGSBEZIRK = lower (:app_user))Bye,
    Seb

  • 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

  • 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

  • Dynamic query table for report based on LOV selected

    Hi,
    Need some suggestion and guidance how to dynamically query table via lov for report .
    Scenario:
    Table, TABLE_LIST, has tablename (table in DB) and filter (for where clause) column. The TABLENAME_LOVE is derived from table TABLE_LIST.
    SELECT TABLENAME D, TABLENAME R FROM TABLE_LIST
    In Page 2,a page select list item,P2_TABLENAME to use TABLENAME_LOV
    All data in tables in the table_list have identical structure (columns, triggers, primary key, and so on).
    I want to have the report region query from the table based on selected LOV.
    Example,
    Tablename Filter
    TB1
    CD2 ACTIVE='Y'
    When select TB1, the report regin will query based on TB1.
    When select CD2, the report regin will query based on CD2 WHERE ACTIVE='Y'
    Question:
    How can I query based on &P2_TABLENAME. WHERE &P2_FILTER.
    Like
    select col1, col2 from &P2_TABLENAME WHERE &P2FILTER
    Greatly appreciate any suggestion and some guidance.
    Tigerwapa

    Hi,
    You should always post your Apex version, DB version and other information as suggested in the FAQ.
    And the moment you talk report you should state whether it is IR or Classic.
    As for your query, have you explored the Report type "SQL Query (PL/SQL function body returning SQL query)" ?
    That might be a good fit for what you are trying to achieve.
    Regards,

  • Execute Query from LOV

    Hi
    There is a Button that run LOV(Show LOV) ,
    how could make the Form Execute Query According to the user Selection from that LOV?
    Thanks

    hi
    Thank you Rahamath and thank you Joachim
    -Create non database item (Item_A). (As you told me Rahamath)
    -Used the LOV to return the value at non database item
    (Item_A) . (As you told me Rahamath)
    -Create Global variable (g_var). (as you told me Joachim)
    -At the trigger When_Button_Pressed I wrote :
    if show_lov (my_lov) then
    go_block('database_block');
    :global.g_var :=:block.Item_A;
         Execute_Query;
    End if;
    - Create Pre_Query Trigger at database block level
    (as you told me Joachim)
         if :global.g_var is not null then
    :id := :global.g_var,
    :global.g_var := null;
    end if ;
    so finally its work
    Thank you a lot for all of you
    bye
    mahmoud

  • When Press "Execute Query" LOV return Item not showing

    I created a LOV and defined return items.
    In the form I created display items, database property NO and assign variable name which is in LOV.
    When I enter a new record LOV shows the return item but when I am executing query only database record is showing and I want to show the all item even they are in database or not.
    Message was edited by:
    Kamran

    execute query populates only database items. To populate non database items after execute query, use post query trigger.

Maybe you are looking for