Select List Value

Hi I have a Select List with Submit and I want to display the display text of the item. I can display the value like this:
htp.p(:P5_MONTH_SELECT);
But this gives me the item value(11) and not the text(November)..
How can I display the text of this item?
Thanks!

Hi Rafikki,
You will need to set up a hidden item called, say, P5_MONTH_NAME. The item's source should be something like:
SELECT MonthName FROM MonthTable WHERE Month = :P5_MONTH_SELECT
(Obviously adjusting the statement to use the right field/table names).
The "Source Used" attribute for this hidden item should be set to "Always, replacing any existing value in session state" to ensure that it is always updated. The value of this field will be set when the page is submitted.
This will then make available the month's name which can be used for display by including &P5_MONTH_NAME. in your text (eg, in a region's title) - make sure you have the & at the start and the dot at the end of the field name.
Regards
Andy

Similar Messages

  • Refresh classic report based on select list value selected

    hello,
    can anyone please help me out with this issue. I have a parameterized classic report based on a select list and I want to refresh this report whenever the select list value is changed. I am using oracle apex version 3.2. i just want to have a javascript function onchange event for the select list which refreshes my report whenever a value is selected.
    My select list item is p1_datastore
    select distinct datastore d,datastore r from my_table1 order by 1;
    My classic report query is
    select * from my_table2 where datastore = :p1_datastore order by last_updated_dt desc;
    ****************************************************thanks,
    orton

    can anyone please help me out with this issue.
    thanks,
    orton

  • Tranferring on "select list" value to another "select list" value

    We have a drill through feature in our application where the user clicks on a value on page 1 and is taken to page 2. (e.g. the user drills on EUROPE in the REGION column on page 1 and is taken to page 2 where they see a report by countries in EUROPE.)
    We also have identical SELECT LISTS on page 1 and on page 2 for REGION (EUROPE, NORTH AMERICA, ASIA). How do we program our application so that when the user clicks on EUROPE on page 1 and is taken to page 2 the value of EUROPE from the REGION SELECT LIST on page 1 is chosen in the REGION SELECT LIST on page 2?
    We tried embedding this in the url for the drill through but the REGION SELECT LIST value on page 2 didn't change.
    In the below link shouldn't the value of the REGION SELECT LIST named P2_REGION be assigned the current value of the REGION SELECT LIST called P1_REGION? (in this case 'EUROPE')
    Thanks for help on this. John Wisnieff
    f?p=&APP_ID.:102:#APP_SESSION#::::P102_PRG1_LINK:#P1CAMP_NAME#,P2_REGION:&P1_REGION

    It would be great to get quick reply on this as we have a project due soon. I just need an answer to the below question:
    In the below link shouldn't the value of the REGION SELECT LIST named P2_REGION be assigned the current value of the REGION SELECT LIST called P1_REGION? (in this case the value is 'EUROPE')
    f?p=&APP_ID.:102:#APP_SESSION#::::P102_PRG1_LINK:#P1CAMP_NAME#,P2_REGION:&P1_REGION

  • Refresh PL/SQL Report Region (not Page) using Select List value

    Hi,
    I've got a report region based on a 'PL/SQL function body returning a SQL query'which gets generated on selecting a value from a Select list item, The Select List action is 'Redirect and Set value' but this causes the whole page to refresh rather than just the report region. I've tried to refresh the report only using a dynamic action on the Select List item (Action now reset to  'None') but now the report is not appearing on choosing from the List. Can anyone suggest a solution that will allow me to refresh this report without refreshing the page? I am using APEX 4.2.2 and the report syntax is as follows:
    DECLARE
      v_statement VARCHAR2(500);
    BEGIN
      SELECT query_text
        INTO v_statement
       FROM sql_queries
       WHERE query_id = :P2_QUERY ;
       RETURN v_statement ;
    END ;
    where P2_QUERY is Select List Item,
    regards,
    Kevin.

    KevinFitz wrote:
    The report region being displayed is conditional on P2_QUERY item being NOT NULL. I assume the region not appearing is because the Action for the Select List Item is set to None and so P2_QUERY is always NULL.
    No, the region is not appearing because it is conditional on P2_QUERY being NOT NULL. This means that the report region never exists on the page shown in the browser, so it can't be dynamically refreshed. (Dynamic refresh doesn't evaluate region conditions, and it only re-renders the report content, not the entire region.)
    Remove the condition on the report region, check the refresh is working, then reconsider exactly what the requirements here are. If you want the region to appear only when P2_QUERY has a value, and you want it to be refreshed without submitting and re-rendering the page, then the region needs to be hidden rather than conditionally rendered, and shown via a dynamic action when P2_QUERY gets a value.
    I tried adding an additional Set Value True Action for the DA event but got an error as listed above,
    All irrelevant if Page Items to Submit on the region is used properly.

  • How to use a select list value in a PL/SQL function body returning SQLquery

    Hi Friends,
    I have a select list P6_TEST with values 'nav' anf 'jyo'. I am trying to create a report using "SQL Query (PL/SQL
    function body returning SQL query)". In my report query can i check if P6_TEST='nav' and do something like the
    code shown below.How can i do that.
    DECLARE
    v_sql VARCHAR2(3000);
    BEGIN
    IF :P6_TEST = 'nav' THEN
    v_sql :=
    'SELECT
    * from department';
    ........................Thanks,
    Nav

    Nav:
    What you have should work. Give it a go. Post back if you run into issues.
    Varad

  • Dynamic Action based on Interactive Report Select List Value

    I'd like to perform a Dynamic Action when a user selects one of 3 options from a Select List within an Interactive Report:
    select APEX_ITEM.SELECT_LIST(
    p_idx => 3,
    --p_value         =>   deptno,
    p_list_values => 'Copy;Copy,Delete;Delete,Export to PDF;Export to PDF',
    --p_attributes    =>   'style="color:red;"',
    p_show_null => 'YES',
    p_null_value => NULL,
    p_null_text => '--Select--',
    --p_item_id       =>   'f03_#ROWNUM#',
    p_item_id => 'P6_IR_SELECT_LIST',
    p_item_label => 'Label for f03_#ROWNUM#',
    p_show_extra => 'YES') "Actions"
    from dual;
    When building the Dynamic Action, I chose the following values from the Advanced wizard
    Event: Select
    Selection Type: DOM Object
    DOM Object: P6_IR_SELECT_LIST
    Condition: Equal to
    Value: "Delete"
    True Action: Execute Javascript Code: Alert('Here');
    Doesn't seem to be firing...can anyone help?
    Thanks in advance,
    John

    Hi,
    I am not sure if the "equal to" condition applies to a DOM object... after all, a DOM object can be anything (any HTML element) not only a field.
    Try using a javascript expression instead, like this:
    $v('P6_IR_SELECT_LIST')=='Delete'UPDATE: Sorry, I just tested and "equal to" condition works for DOM objects... should have tested before posting!
    Luis
    Edited by: Luis Cabral on Feb 29, 2012 4:45 PM

  • Using select list value as column name in SQL

    Folks,
    Thanks in advance for any help with this
    I have a select list with two values (Instance and Username) created by
    STATIC2:Username;USERNAME,Instance;INSTANCE
    I am trying to pass the value of this (:P2_SELECT) and use it as a column name in a SQL query as below
    select USERNAME,
    INSTANCE
    from table_name
    where :P2_SELECT like '%'||:P2_TEXTSEARCH||'%'
    When I substitue the :P2_SELECT for one of the values (either instance or username) this works fine
    I suspect it is due to how Application Express interprets the value of :P2_SELECT
    Any help would be much appreciated!
    Gareth

    Thanks Munky that worked a treat!
    The next hurdle I have now is that because I have changed the region type to "PL/SQL Function(returning SQL Query)" there is no longer the option to add sorting to the columns as I have had to change the Source option to "Use Generic Column Names (parse query at runtime only)"
    I will have a scout around and see how I can get around this
    Gareth

  • Need to use Select List value as column name

    I want to have a WHERE ? IS BETWEEN ? AND ? clause.
    I am using the PL/SQL Query returning a SQL Query as a report. This uses bind variables for items I had set on my form..... If I hardcode something like:
    'WHERE STARTDATE IS BETWEEN '||
    'TO_DATE(:P1_START,''dd-MON-YYYY HH24:MI'') AND '||
    'TO_DATE(:P2_END,''dd-MON-YYYY HH24:MI'')';
    I have no problem, but I have 2 date columns, STARTDATE and ENDDATE, and would like to use the value in a select list and not have to hardcode "STARTDATE" in there. I have not been able to do this, does anyone know how to use a bind variable as a column name? From reading some posts I think it might not be possible.

    Heather,
    You're on the right track, just glue in the column name so that it becomes part of the returned query string from the function (...'WHERE '||:COLNAME||' IS BETWEEN '|| ...).
    Note that the bind variable is not part of the returned query string, but the column name obtained from the bind variable when the function executes does become part of the query string.
    Scott

  • Pass Select list value to URL as a parameter

    I am trying to pass the selected value from a select list via a button to a URL.
    &P_VALUE=&P_VALUE.
    P_VALUE is set to USER SESSION.
    It shows as prevous session value. If I show the the session value is not set to the selected value.
    If I call a PDF report via a button, it displays the correct value and the session values is correct.
    If I select the button for the URL again, is shows the previous value.
    When I go back to the form and call select the button again, the correct parameter is passed to the URL.
    Any Ideas?
    Thanks,
    Jerry

    If you use substitution at the time, the button gets generated, you don't have the new value - the button is generated with the rest of the page, and then later the user changes value of the select list. You have two choices:
    1)Use Select list with submit - and transfer the user to second page using branch (which get's calculated after submit when select list has already the new value)
    2)Use Javascript to catch the onChange/onClick event of SelectList, read the current value and do the redirect from JavaScript.

  • Select List value as Query variable

    Hi, l have a Select List and l need to put its return value inside a query to define a column.
    Select List items are "name" and "id" and l would that when l select "name" the query is:
    SELECT ...
    FROM ...
    WHERE "TAB1"."NAME" = :VAR;
    and when l select "id" the query is:
    SELECT ...
    FROM ...
    WHERE "TAB1"."ID" = :VAR;
    Is it possible to do that ??? In which way ???
    (it's several hours I'm trying but without positive solution)
    THANKS

    Assuming there is no correlation between name and id you could have just one item say P1_SEARCH and use it like this
    select ...
    from tab1
    where upper(name) = upper('%'||:P1_SEARCH||'%')
    or id = :P1_SEARCH
    That also has wildcard and is case insensitive. so if you entered smit in the search box you would find Smith or SMIT etc. The id must be an exact match.
    Do try the original idea you could try creating a SQL region on a function returning a query.
    declare
    v_sql varchar2(1000) := '';
    begin
    v_sql := 'select * from tab1 ';
    if v('P1_SELECT_LIST') = 'ID' then
    v_sql := v_sql || where id = '|| v('VAR');
    else
    v_sql := v_sql || where name = '|| =v('VAR');
    end if;
    return v_sql;
    end;

  • Get Apex Select List value

    Hello,
    I've used APEX_ITEM.SELECT_LIST_FROM_QUERY in one of my dynamically built report.
    SELECT 'Add' "Add",(SELECT APEX_ITEM.SELECT_LIST_FROM_QUERY (1,ENAME,'SELECT DISTINCT ENAME,EMPNO FROM EMP') FROM EMP WHERE ROWNUM=1) "SELECT",A.* FROM ('||OBJ_SQL||') A ORDER BY 2;
    OBJ_SQL we get from a table which contains a query. The query is different for each of the selection made in another region. Probably a select list with different countries and clicking on each country, the below dynamic report should be built. Each country will be having different columns. So we store all the countries and respective queries in a table. The report should appear as :
    Add is a link.
    Select is a select list with Employee Names.
    Some Other columns from the query corresponding to the country.
    My requirement is Whenever I click on Add link for any row, the different columns in each row should be inserted into a table. I tried using a javascript call to a function passing all the values like #COL2#,#COL3# etc. But for the select list, though I select SCOTT, the whole string (all employees are concatenated) is being sent.
    Is there a way we can pass only the selected value to the javascript function? How can we achieve this? Please help.
    The select list gets displayed perfectly.

    Hey.
    Somebody help me please.
    I have to get value from APEX_ITEM.SELECT_LIST_FROM_QUERY - column on a report.
    SELECT DISTINCT ROLE AS GET_ROLE,
    JOB AS GET_JOB,
    APEX_ITEM.SELECT_LIST_FROM_QUERY
    ( 1, '%', 'SELECT DISTINCT CODE c,
    MODE m
    FROM T2
    WHERE ROLE = ' || ROLE
    ) AS GET_CODE
    FROM T1
    WHERE AGE >30 AND
    SEX = 'M' ;
    I was trying to use javascript :
    for (var i = 0; i < selectlist_name.options.length; i++)
    if (selectlist_name.options[ i ].selected)
    result=selectlist_name.options;
    but I don't know what is the name of this APEX_ITEM.SELECT_LIST_FROM_QUERY and what "selectlist_name" must be there.

  • Using Select List value for building report

    I have an interactive report form. I have a "After Header" (LOAD) process that run sql commands that will populate a table with the data that the report needs for a given week.
    I have a Select List item that is run as a "Before Header" that gets a list of dates from a table. The dates only contain the first day of the week for the past two years. It is called "WEEK_OF" table and the column is called "WEEK_OF_DATE".
    The default value for the Select List is the first day of the current week. And then all of the first day of the week from the WEEK_OF table.
    I would like the LOAD process to use the value in the Select List. So at start up I would like the List to show the current week and report to begin with data from the current week.
    So I have tried to use the variable :WEEK_OF_DATE (Item name) as the beginning date for the report. However :WEEK_OF_DATE is null.
    Also, after I have the report displayed, I would like to select a new date from the list and have the report automatically refresh with that new data.
    Any Ideas what I am doing wrong?

    Hi Lyle,
    When setting a default value for a select list that is to be used to filter a report, I have found it best to do that using a computation, conditional on the item being NULL and running Before Header. If other computations rely on this value, then it should have the lowest sequence number to ensure that the value is available for those.
    Andy

  • Automatically update text field depending on the in select list value

    I have got 2 tables. Table A (Employee Personal Detail), Table B (Employee Academic detail). Employee no is common field between two tables).
    I have created interactive report with form on table b using in-built templates. I have added text box on form to display employee name which is stored in table A. I want to automatically display employee name depending upon value in employee no field on form. I know I can write query to get value in employee name field. It gives me error when employee no is blank. How to handle error?

    Sagar,
    For the employee name value to change according to the emp_no, your page needs to get submitted. can you use a select list with submit for emp_no? And then use the PL/SQL mentioned above to run on page submit?
    I'm not sure but I guess you can also achieve this in Ajax. May be someone expert in that could help.

  • Update fails when select list value isn't changed

    Hi Folks,
    I am using htmldb_item to create a report form that is updateable. There is a checkbox in the first column and I am using a technique discussed in the forum to make sure I am getting the values from the checked rows in order to perform the updates.
    However, I have noticed that if I do not change the selection in the select list, and check the "update row" checkbox, I get a "ORA-01722: invalid number" error.
    I'll provide both the select and update statements and would appreciate it if someone could help me discern a solution.
    == SELECT STATEMENT ==
    select
    htmldb_item.checkbox(1,rownum),
    htmldb_item.hidden (2, p.id) ||
    htmldb_item.text(3,p.project_name, 40) as project_name,
    htmldb_item.select_list(4, p.gts_dependant, 'Y;Y,N;N', null, 'NO')as GTS_Dependant,
    htmldb_item.select_list(5, p.gxp_relevant, 'Y;Y,N;N', null, 'NO') as GxP_Relevant,
    htmldb_item.select_list_from_lov(6, u.user_first_name||' '||u.user_last_name,
    'PROJECT_MANAGERS', NULL, 'NO') as project_manager
    from
    eprs_project p, eprs_project_monthly pm, eprs_user u
    where
    p.id = pm.project_id and
    pm.project_manager = u.id and
    to_char(record_date, 'MON YYYY') = to_char(sysdate, 'MON YYYY') and
    p.program_id = :P8_SELECT_PROGRAM== SUBMIT STATEMENT ==
    for i in 1..HTMLDB_APPLICATION.G_F01.COUNT
    loop
    update eprs_project set
    project_name = HTMLDB_APPLICATION.G_F03(HTMLDB_APPLICATION.G_F01(i)),
    gts_dependant = HTMLDB_APPLICATION.G_F04(HTMLDB_APPLICATION.G_F01(i)),
    gxp_relevant = HTMLDB_APPLICATION.G_F05(HTMLDB_APPLICATION.G_F01(i))
    where id = HTMLDB_APPLICATION.G_F02(HTMLDB_APPLICATION.G_F01(i));
    update eprs_project_monthly set
    project_manager = HTMLDB_APPLICATION.G_F06(HTMLDB_APPLICATION.G_F01(i))
    where project_id = HTMLDB_APPLICATION.G_F02(HTMLDB_APPLICATION.G_F01(i)) and
    to_char(record_date, 'MON YYYY') = to_char(SYSDATE, 'MON YYYY');
    end loop;
    Analysis
    I've narrowed the behavior down to the Select List. The "u.user_first_name||' '||u.user_last_name" assembles the first name and last name from the user table, but must not have a value associated with it, as the rest of the names do (because they come from the application LOV "PROJECT_MANAGERS." Therefore, when the user checks the "Update Row" checkbox (rownum), there is no value associated with the selection. This would explain the invalid number error message.
    If this is correct, then I am not understanding the SELECT_LIST_FROM_LOV function sufficiently. The documentation says about the p_value parameter: "This value should be a value in the p_list_values parameter." This is a small cut and paste typo because there is no p_list_values parameter, but rather a p_lov parameter. Anyway, the p_value is the default displayed value, which ideally would be one of the items from the p_lov list. It is, but not really. By that I mean, the current value is a valid name but isn't from the application LOV, per se. Therefore, I had proceeded merrily on my way believing I had fulfilled the API requirements because I had provided a "current value" and an application LOV.
    The example in the user guide provides only a column name for the p_value parameter, so I don't understand how I would associate a value with the display item (from the p_value parameter) to prevent the error message from being generated. Is there a best practice for this?
    Any guidance would be most gratefully appreciated.
    Yours,
    Petie

    Hi. I've tried a few things to get a value into the p_value parameter.
    Attempt 1:
    u.user_first_name||' '||u.user_last_name;u.idAttempt 2:
    'u.user_first_name||'' ''||u.user_last_name;u.id'Unfortunately, neither of these was successful. The first one wasn't valid syntax and the second was reproduced as a string literal.
    Have I stumped everyone? Or am I just missing something really obvious? Any thoughts? Any workarounds? Should I create an intermediate view with the first and last names already concatanated? That wouldn't put the ID into the p_value parameter. The examples in the Users Guide don't address the value part of the "Display/Value" pairing in the Select List. They provide either a static display or a single column.
    Right now, I have to put something like the following into the users manual:
    "When updating core project data, you must re-select the first occurance of the project managers name from the select list. If you do not re-select the project manager name, you will receive an error when you Submit the data for update."
    IMHO, this is pretty lame. Don't you agree?
    Thanks for reading and any thought you can offer.
    Petie

  • Dynamic select list values ?

    Hi Marvel team.
    I hae two select lists in my page (A, B), when selecting a value in the list A, the list B must display some values based on what I have select
    in the List A.
    How can I start to di this please ?
    Thanks for any help.
    Jina.

    Hello Neelesh Shah,
    I have tried what you explain, but the select list with submit do not wotk properly,
    when selecting a value in the list, he page submit but the value of the list is the last one !
    and if I set the source user attribute at : always...... the value of the list is always null even if I select a value !!
    Is it a bug ?
    Thanks.
    Jina.

Maybe you are looking for

  • How to remove remove page headers and footers

    Hello I can't seem to remove headers and footers from my sheet in print view. I am trying to print a chart and the header and footer are eating up valuable real estate! When using 'Pages' I can simply turn them off, where is the equivalent setting in

  • How to know if system is running in 40W low performance mode ?

    I experienced the same problem than described in this topic: lower performance with charger than with battery! (But I had set everything on Maximum Performance both in BIOS and in Windows's Power settings, so I think everything was done on software-s

  • 10g ports with redundancy

    Hi all. I hope this is the right section to post this kind of question. Basically I need to know which switch should I buy to achieve the customer's needs. Each floor will have 1 x 2960 with 2 10GB uplink to the core switch. The problem is I don't kn

  • How many systems can be accessed to a single SQL Server?

    I am a C# developer. I am developing a C# application. I need to install application in all the client PC's and I am planning it to install SQL Server in a single pc or server. I am planning to give the connection to sql server from the client pc's.

  • Why is it that flash only crashes when I download a picture to email in my outlook account

    Flash seems to work fine with any other application I have used. Even before on my hotmail account, I would send emails with pictures or videos and had no problem. It seems to be only since I had to upgrade from Hotmail to Outlook that this problem h