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

Similar Messages

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

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

  • Failed When converting nvarchar value SC1 to int (Cinf)

    Hai,
               In my screen conversion master after entering all the data's if i click addon button the error showing
    Conversion Failed When converting nvarchar value 'SC1' to int (Cinf)
    where SC1 is the object code of my form.
    Can anyone suggest what could be the problem?
    Regards

    Hi Anitha,
    Please check the variable @object_type in the SBO_SP_TransactionNotification stored procedure in your company database. In older versions of SBO, this had an int datatype. In 2007A or 2007B, this should be nvarchar(20) and you will get a conversion error when adding or updating UDO data if the variable is still an int datatype. Please see SAP Note 967470 for more details.
    Kind Regards,
    Owen

  • HT2284 Recurring "connection failed" when selecting TimeCapsule in the sidebar (internet connection works fine).  Clicking "Connect As" starts the cyle over again but ends in "There was a problem connection to the server" message.  Only fix is resetting T

    Recurring "connection failed" when selecting TimeCapsule in the sidebar (internet connection works fine).  Clicking "Connect As" starts the cyle over again but ends in "There was a problem connection to the server" message.  Only fix is resetting TC.
    The TC is the wifi base station, also have AirportExpress on the network, both of which work fine.  The TC has an external disc connected as well, which is also visible in the sidebar but also cannot be connected to.  Several MB computers use the network, all of which either can or cannot connect to the TC disc depending on when it is acting up.
    Any ideas other than clicking "connect as" or powering down the network every time? 

    Read up how to install 5.6 utility into ML.. it is pretty easy.
    I downloaded 5.6
    http://support.apple.com/kb/DL1482
    Download unpkg
    http://www.timdoug.com/unpkg/
    Open the dmg to get the pkg.. drag it onto unpkg.. and it will create a directory under desktop with all the files.. drag the application to the utility directory.. or just run it direct.
    Google if you want more explicit instructions.
    Much easier with a real tool instead of a toy.
    Hold the option key when you select firmware update.. all the old ones will appear.
    But this will not work on newer Gen4.. only on every other model and early Gen4. .I do not know when they turned the corner and started this only 7.6 nonsense.

  • 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

  • I just updated my iPhone 4 to iOS6.  In the process, I ran into a problem and had to restore factory settings.  After syncing the phone, I see that 218 apps need to be updated. When selecting "update all," it says "manage local device storage usage." How?

    I just updated my iPhone 4 to iOS6.  In the process, I ran into a problem and had to restore factory settings.  After syncing the phone, I see that 218 apps need to be updated. When selecting "update all," it says "Cannot Download.  There is not enough available local storage to download these items.  You can manage your local device storage usage in Settings."
    How can this be the case when I haven't changed any apps from before updrading to iOS6, and I don't have any music yet on the phone?  Why is it telling me there is not enough local space?

    Hi RileyAvaCadenRiver,
    If you recently updated your iPhone to iOS7, you will need to update iTunes on your computer to iTunes 11.1 or newer for it to correctly recognize the iPhone. You may find the following link helpful:
    Apple: iTunes 11.1.1
    http://support.apple.com/kb/DL1614
    Regards,
    - Brenden

  • 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

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

  • 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

  • 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

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

  • 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

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

Maybe you are looking for

  • .pages file cannot be opened in pages

    I've been working yesterday and today on a report for a customer in pages with many graphs. Tonight, I planned to finish the report, but Pages can't open the document anymore. I've tried many things: - Open it in Pages via 'open documents' - Open it

  • Playback Frozen in iTunes

    OK, here's the deal. This question is directly about one major problem I'm having, but it's also about something else, just cause I'm going to mention it here, rather than in another post. Problem number one: When I double click on a song (or on an a

  • How do I change my Japanese Photoshop for an English one in the Design and Web Premium CS6 series?

    Hi, I recently purchased a Japanese version of Design and Web Premium CS6, I called Adobe and got a set of serial number for an English version. All the programs except for Photoshop were successfully translated into English. How do I get an English

  • Java in iOS for Xcode

    So I have made a code in Java that I would like to turn in to an application. I have a little background withmaking applescript apps for mac, but is it even possible to make an iOS app using java? I know that mobile apple devices don't support java t

  • A Friend can not down load itunes to his computer has windows xp .

    Has tried several times with no luck. Icon does not appear on desk top ,it appears in cProgram files but does not open when clicked on. Any information would be helpful Lewis C.